Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-38520 Overview
SoftEtherVPN is an open-source cross-platform multi-protocol VPN program. When deployed with Layer 2 Tunneling Protocol (L2TP) enabled, the server responds to every incoming packet with two response packets larger than the original request. This behavior allows attackers to spoof source IP addresses and use the SoftEtherVPN host as a reflector in amplification distributed denial-of-service (DDoS) campaigns against third-party targets. The flaw is tracked under CWE-400 (Uncontrolled Resource Consumption) and was patched in version 5.02.5185.
Critical Impact
Exposed SoftEtherVPN instances with L2TP enabled can be abused as reflectors to generate amplified DDoS traffic against arbitrary internet targets.
Affected Products
- SoftEtherVPN versions prior to 5.02.5185
- Deployments with L2TP/IPsec enabled
- Cross-platform builds (Windows, Linux, macOS, FreeBSD, Solaris)
Discovery Timeline
- 2024-06-26 - CVE-2024-38520 published to the National Vulnerability Database (NVD)
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-38520
Vulnerability Analysis
The vulnerability resides in the Internet Key Exchange (IKE) packet handling path within src/Cedar/Proto_IKE.c. When SoftEtherVPN receives an IPsec packet referencing an unknown Security Parameter Index (SPI), the server generates two response packets to notify the sender of the invalid Security Association (SA). Each response is larger than the inbound request, producing a bandwidth amplification factor greater than one.
Because User Datagram Protocol (UDP) traffic has no handshake, an attacker can forge the source IP address of these invalid-SPI packets. The SoftEtherVPN host then directs its amplified replies to the spoofed victim rather than the actual sender. Many such reflectors in parallel produce an effective reflection and amplification attack.
Root Cause
The root cause is non-compliance with RFC 4303, which specifies that packets referencing unknown SPIs should be silently dropped. SoftEtherVPN instead issued cookie-bearing responses, enabling the reflector pattern.
Attack Vector
An unauthenticated remote attacker sends crafted IPsec/ISAKMP packets to UDP ports 500 and 4500 on a SoftEtherVPN host, spoofing the source IP of the intended victim. The server responds with two larger packets per request, which arrive at the victim as attacker-sourced traffic.
// Patch excerpt from src/Cedar/Proto_IKE.c
seq = READ_UINT(src + sizeof(UINT));
// Search and retrieve the IPsec SA from SPI
// thank to @phillibert report, responding to bad SA might lead to amplification
// according to RFC4303 we should drop such packets
ipsec_sa = SearchClientToServerIPsecSaBySpi(ike, spi);
if (ipsec_sa == NULL)
{
// Previously generated cookies and response packets here.
// The fix removes the response path so invalid-SPI packets are dropped.
}
Source: GitHub commit c2a7aa5. The patch removes the cookie-based response branch and drops packets referencing unknown SPIs.
Detection Methods for CVE-2024-38520
Indicators of Compromise
- Unexpected outbound UDP traffic from the SoftEtherVPN host on ports 500 and 4500 toward unrelated internet destinations.
- Bursts of inbound IPsec packets referencing unknown SPIs from distributed source addresses.
- Response-to-request packet ratios greater than 1:1 on the IKE listener.
Detection Strategies
- Monitor UDP 500 and 4500 for asymmetric traffic patterns where the server emits more bytes than it receives from a given peer.
- Capture IKE traffic with tcpdump or Zeek and alert on repeated INVALID_SPI notifications or malformed ISAKMP cookies.
- Correlate SoftEtherVPN host network telemetry with external DDoS reports naming the host as a traffic source.
Monitoring Recommendations
- Ingest firewall and NetFlow records into a centralized analytics platform to baseline normal IKE traffic volume.
- Alert when outbound UDP 500/4500 traffic exceeds inbound traffic for sustained windows.
- Track SoftEtherVPN version strings across the fleet and flag any instance running a release older than 5.02.5185.
How to Mitigate CVE-2024-38520
Immediate Actions Required
- Upgrade all SoftEtherVPN deployments to version 5.02.5185 or later.
- Disable L2TP/IPsec on hosts where it is not required for business operations.
- Restrict inbound UDP 500 and 4500 to known client address ranges where feasible.
Patch Information
The fix is published in SoftEtherVPN Release 5.02.5185 and tracked in GitHub Security Advisory GHSA-j35p-p8pj-vqxq. The patch aligns IKE handling with RFC 4303 by silently discarding packets with unknown SPIs instead of returning cookie responses.
Workarounds
- Apply ingress rate limiting on UDP 500 and 4500 at the perimeter firewall to cap reflector throughput.
- Enforce source-address validation (BCP 38) on upstream networks to reduce spoofed traffic reaching the host.
- Terminate L2TP/IPsec on a dedicated interface protected by an access control list limiting client source addresses.
# Example iptables rate limit for IKE/IPsec NAT-T ports
iptables -A INPUT -p udp --dport 500 -m limit --limit 10/s --limit-burst 20 -j ACCEPT
iptables -A INPUT -p udp --dport 500 -j DROP
iptables -A INPUT -p udp --dport 4500 -m limit --limit 10/s --limit-burst 20 -j ACCEPT
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.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

