CVE-2023-41913 Overview
CVE-2023-41913 is a buffer overflow vulnerability in strongSwan, an open-source IPsec-based VPN solution, that can lead to unauthenticated remote code execution. The vulnerability exists in the charon-tkm daemon's DH (Diffie-Hellman) proxy component, where a crafted DH public value that exceeds the internal buffer can trigger a buffer overflow condition. An attacker can exploit this vulnerability by sending a specially crafted IKE_SA_INIT message to vulnerable strongSwan installations.
Critical Impact
This vulnerability allows unauthenticated remote attackers to execute arbitrary code on affected strongSwan VPN servers by exploiting a buffer overflow in the DH proxy component via malicious IKE_SA_INIT messages.
Affected Products
- strongSwan versions 5.3.0 through 5.9.11
- strongSwan charon-tkm daemon component
- Systems using the Trusted Platform Module (TPM) key manager with strongSwan
Discovery Timeline
- 2023-12-07 - CVE CVE-2023-41913 published to NVD
- 2025-12-18 - Last updated in NVD database
Technical Details for CVE-2023-41913
Vulnerability Analysis
The vulnerability resides in the charon-tkm component of strongSwan, which provides integration with the Trusted Platform Module (TPM) for key management operations. The charon-tkm daemon implements a proxy for Diffie-Hellman key exchange operations, forwarding DH parameters to the TKM (Trusted Key Manager) for cryptographic processing.
The buffer overflow occurs when processing DH public values received during the IKE (Internet Key Exchange) Security Association initialization phase. When a remote peer sends an IKE_SA_INIT message containing a DH public value larger than the internal buffer allocated in the DH proxy, the excess data overwrites adjacent memory. This classic buffer overflow condition can be leveraged by attackers to corrupt memory structures and potentially achieve arbitrary code execution.
Since the vulnerability can be triggered via network-accessible IKE_SA_INIT messages without requiring prior authentication, it presents a severe risk to internet-facing VPN gateways running the affected charon-tkm daemon.
Root Cause
The root cause is a classic buffer overflow (CWE-120) stemming from insufficient bounds checking when copying DH public values into a fixed-size internal buffer within the charon-tkm DH proxy implementation. The code fails to validate that incoming DH public values conform to the expected buffer size before copying data, allowing oversized values to overflow the allocated buffer space.
Attack Vector
The attack is network-based and requires no authentication or user interaction. An attacker can target any strongSwan instance running charon-tkm that is reachable over the network (typically on UDP ports 500 and 4500 for IKE traffic). The attack sequence involves:
- Identifying a target running strongSwan with charon-tkm enabled
- Crafting a malicious IKE_SA_INIT message with an oversized DH public value
- Sending the crafted message to the target's IKE listening port
- The buffer overflow corrupts memory, potentially allowing code execution
The vulnerability affects strongSwan versions 5.3.0 through 5.9.11. The charon-tkm daemon is a specialized component used when strongSwan is configured to use TPM-based key management, so not all strongSwan deployments are vulnerable—only those specifically utilizing the TKM integration.
Detection Methods for CVE-2023-41913
Indicators of Compromise
- Unexpected crashes or restarts of the charon-tkm daemon process
- Anomalous IKE_SA_INIT messages with unusually large DH public value payloads in network traffic
- Core dumps or memory corruption errors related to strongSwan processes
- Suspicious outbound connections or processes spawned by charon-tkm
Detection Strategies
- Monitor IKE traffic (UDP ports 500/4500) for abnormally large DH public value payloads exceeding expected key sizes
- Implement intrusion detection rules to flag IKE_SA_INIT messages with oversized DH parameters
- Enable strongSwan debug logging to capture detailed information about incoming IKE negotiations
- Deploy network-based anomaly detection to identify unusual IKE traffic patterns
Monitoring Recommendations
- Configure process monitoring to alert on unexpected charon-tkm daemon terminations
- Implement log aggregation and analysis for strongSwan log files to detect exploitation attempts
- Monitor system resources for signs of post-exploitation activity following IKE traffic anomalies
- Establish baseline metrics for normal IKE traffic volume and message sizes to detect deviations
How to Mitigate CVE-2023-41913
Immediate Actions Required
- Upgrade strongSwan to version 5.9.12 or later immediately on all affected systems
- If immediate patching is not possible, consider temporarily disabling charon-tkm if TPM key management is not strictly required
- Review network access controls to limit IKE traffic sources to trusted peers only
- Implement network segmentation to reduce the attack surface of VPN gateway systems
Patch Information
strongSwan has released version 5.9.12 which addresses this buffer overflow vulnerability. Organizations should prioritize upgrading all strongSwan installations, particularly internet-facing VPN gateways running the charon-tkm component. Patch information and release notes are available through the official strongSwan blog post and the strongSwan GitHub releases page. Linux distributions including Debian and Fedora have also issued updated packages—refer to the Debian LTS Security Announcement and Fedora Package Announcement for distribution-specific updates.
Workarounds
- Disable charon-tkm and use standard charon daemon if TPM key management is not required for your deployment
- Implement strict firewall rules to allow IKE traffic only from known, trusted peer IP addresses
- Deploy a Web Application Firewall (WAF) or IPS with rules to inspect and filter malformed IKE packets
- Consider using VPN termination proxies that can filter traffic before it reaches strongSwan
# Check installed strongSwan version
strongswan version
# For Debian/Ubuntu systems, upgrade to patched version
sudo apt update && sudo apt upgrade strongswan
# For Fedora/RHEL systems, upgrade to patched version
sudo dnf update strongswan
# Verify charon-tkm is not running if not needed
ps aux | grep charon-tkm
# Restrict IKE traffic to known peers via iptables (example)
sudo iptables -A INPUT -p udp --dport 500 -s <trusted_peer_ip> -j ACCEPT
sudo iptables -A INPUT -p udp --dport 500 -j DROP
sudo iptables -A INPUT -p udp --dport 4500 -s <trusted_peer_ip> -j ACCEPT
sudo iptables -A INPUT -p udp --dport 4500 -j DROP
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

