CVE-2021-41991
strongSwan vulnerability analysis and mitigation

Overview

The in-memory certificate cache in strongSwan before 5.9.4 has a remote integer overflow vulnerability discovered by researchers at the NSA. The vulnerability affects all versions since 4.2.10 when the certificate cache is enabled (which is the default setting). The issue occurs when replacing certificates in the cache once it becomes full (Strongswan Blog).

Technical details

When the in-memory certificate cache becomes full (32 slots), the code attempts to find a slot that has been used less than or equal to half the average use count. It uses a random offset to start the search, but if the random() function returns a very high value close to RAND_MAX (usually 2^31-1), this can cause an integer overflow in the index calculation, resulting in an out-of-bounds array access at a negative index value. This leads to a double-dereference and a call using out-of-bounds memory (Strongswan Blog).

Impact

The primary impact is a denial of service through a segmentation fault when the vulnerability is triggered. While remote code execution cannot be completely ruled out, it is considered unlikely since attackers have no control over the dereferenced memory. Triggering the bug reliably requires thousands of requests over approximately 1-2 days (Strongswan Blog, Debian Security).

Mitigation and workarounds

The vulnerability is fixed in strongSwan version 5.9.4. For older versions, patches are available for versions 4.4.1 and newer. Systems that don't have the in-memory certificate cache enabled (charon.cert_cache) are not vulnerable, though this is enabled by default (Strongswan Blog, Fedora Update).

Additional resources


SourceThis report was generated using AI

Related strongSwan vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2023-41913CRITICAL9.8
  • strongSwanstrongSwan
  • strongswan-hmac
NoYesDec 07, 2023
CVE-2023-26463CRITICAL9.8
  • strongSwanstrongSwan
  • net-vpn/strongswan
NoYesApr 15, 2023
CVE-2022-40617HIGH7.5
  • strongSwanstrongSwan
  • strongswan
NoYesOct 31, 2022
CVE-2022-4967MEDIUM6.5
  • strongSwanstrongSwan
  • cpe:2.3:a:strongswan:strongswan
NoYesMay 14, 2024
CVE-2025-62291N/AN/A
  • strongSwanstrongSwan
  • strongswan-nm
NoYesOct 27, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management