Security Advisory

CVE-2023-41913: strongSwan charon-tkm Overflow

Last updated:
  • CVE-2023-41913

CVE-2023-41913 is a stack buffer overflow in charon-tkm, the Trusted Key Manager variant of strongSwan's IKE daemon: from 5.3.0 to 5.9.11 it copies a peer's Diffie-Hellman public value into a 512-byte buffer unchecked, so one unauthenticated IKE_SA_INIT can overflow it. NVD scores it 9.8; 5.9.12 fixes it.

Vulnerability summary

CVSS base score

9.8

Critical severity

EPSS score (FIRST)

2.3%

Probability of exploitation in the wild in the next 30 days

CISA KEV catalog

No

Not listed

Published

Vulnerability ID: CVE-2023-41913 · Source: NVD

Affected components

ComponentCPEVersion range
strongSwan (charon-tkm IKE daemon)cpe:2.3:a:strongswan:strongswan:*:*:*:*:*:*:*:*NVD: 5.3.0 to before 5.9.12; fixed in 5.9.12, patches for older releases (strongSwan advisory); only setups that use charon-tkm
OpenWrt packages feed: strongswancpe:2.3:a:strongswan:strongswan:*:*:*:*:*:*:*:*updated to 5.9.12 on 2023-11-27; openwrt-23.05 builds 5.9.11; no charon-tkm package in the Makefile (read 2026-11-18)

What does this mean for affected devices?

The strongSwan advisory of 20 November 2023 traces the bug to a refactoring in 5.3.0, which moved the length check for Diffie-Hellman public values out of the KE payload code and into each DH implementation. The implementation in charon-tkm, which proxies DH operations between the IKE daemon and the Trusted Key Manager (TKM), was missed. Since then it has contained an unchecked memcpy() that copies whatever public value the peer sends in its unauthenticated IKE_SA_INIT message into a 512-byte buffer on the stack. The only limit is the maximum accepted IKE message size, 10,000 bytes by default, and strongSwan says remote code execution "might be possible". Florian Picca of Stackered reported it.

NVD's Primary score is CVSS v3.1 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) with CWE-120, the same score and CWE as CISA's ADP entry; strongSwan classes it as CWE-121, stack-based buffer overflow. NVD's CPE range covers strongSwan from 5.3.0 up to, but excluding, 5.9.12 (NVD), and it does not distinguish charon-tkm from the standard daemon.

Is a strongSwan gateway exposed if it runs plain charon?

No. strongSwan states that "setups that don't use charon-tkm as IKE daemon are not vulnerable", and that the multi-key-exchange version of charon-tkm released with strongSwan 6 is not vulnerable either. charon-tkm is a separate daemon built to run against a TKM, and the common embedded build recipes do not offer it: on 2026-11-18 the OpenWrt strongswan Makefile, Buildroot's strongswan package and the meta-openembedded strongSwan 6.1.0 recipe have no charon-tkm option. A router built from them runs charon or charon-systemd and does not contain the vulnerable code.

That still produces scanner findings, because NVD's range matches the version string alone. OpenWrt's feed moved to strongSwan 5.9.12 on 2023-11-27, but its openwrt-23.05 branch builds 5.9.11, which falls in the range. For such images, check the root file system for a charon-tkm binary; if there is none, record the CVE as not affected in a VEX statement rather than leaving it open.

How do you fix CVE-2023-41913?

Upgrade to strongSwan 5.9.12 or later, or apply the patch strongSwan publishes for older releases; the Debian security tracker links the patch directory and lists the fixed packages from DSA-5560-1 for bullseye (5.9.1-1+deb11u4) and bookworm (5.9.8-5+deb12u1) and DLA-3663-1 for buster (5.7.2-1+deb10u4). A device that does use charon-tkm should take the fix first, since the overflow sits before any authentication.

Our OpenVPN and strongSwan firmware guide uses this CVE as the example of a bug reachable before the peer is known, and the memory corruption fix guide covers the unchecked-copy bug class. Related memory bugs in remote-access code include CVE-2024-21762, an unauthenticated out-of-bounds write in the Fortinet SSL-VPN, and CVE-2026-55200, a packet-length overflow in libssh2 that a malicious server can trigger. Older and newer strongSwan flaws are covered in CVE-2018-16151 and CVE-2026-78135, and the OpenVPN side in CVE-2025-13086.

CVE-2023-41913 is not in the CISA KEV catalog as of 2026-11-18 (catalog version 2026.11.17). FIRST EPSS gives it 0.0229, the 84th percentile, in the 2026-11-17 dataset (CISA KEV, FIRST EPSS).

How to fix this class of issueThis advisory's weakness class is Memory corruption. Our practical guide covers how to detect, fix, verify and disclose it: How to fix memory corruption in embedded firmware.

Evidence

  • strongSwan advisory 2023-11-20: charon-tkm does not check the length of received DH public values before copying them to a 512-byte stack buffer (CWE-121); reachable with an unauthenticated IKE_SA_INIT; length limited only by the maximum IKE message size, default 10000 bytes; remote code execution might be possible; all versions since 5.3.0 affected; setups not using charon-tkm are not vulnerable; multi-KE charon-tkm (strongSwan 6) not vulnerable; fixed in 5.9.12, patches for older releases; reported by Florian Picca (Stackered). — strongSwan
  • NVD Primary CVSS 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H; CISA-ADP 9.8 same vector; CWE-120 (NVD and CISA-ADP); CPE strongswan 5.3.0 to <5.9.12; published 2023-12-07. — NVD
  • OpenWrt packages commit ed30ca0f (2023-11-27) strongswan: Update to 5.9.12; openwrt-23.05 Makefile PKG_VERSION 5.9.11; master Makefile has no tkm package or option (read 2026-11-18). — OpenWrt packages feed
  • meta-openembedded strongswan_6.1.0.bb and Buildroot package/strongswan have no charon-tkm option (read 2026-11-18). — OpenEmbedded
  • Debian: fixed in buster 5.7.2-1+deb10u4 (DLA-3663-1), bullseye 5.9.1-1+deb11u4 and bookworm 5.9.8-5+deb12u1 (DSA-5560-1), unstable 5.9.12-1; patches at download.strongswan.org/security/CVE-2023-41913/. — Debian security tracker
  • Not in the CISA KEV catalog, version 2026.11.17, checked 2026-11-18. — CISA KEV
  • EPSS 0.0229, percentile 0.83531, dataset 2026-11-17. — FIRST EPSS

Related advisories

Sources

  1. NVD
  2. strongSwan security advisory: CVE-2023-41913, charon-tkm DH public value buffer overflow
  3. strongSwan patches for CVE-2023-41913
  4. OpenWrt packages: strongswan update to 5.9.12
  5. OpenWrt packages: strongswan Makefile
  6. OpenWrt packages openwrt-23.05: strongswan Makefile
  7. meta-openembedded strongSwan 6.1.0 recipe
  8. Debian security tracker: CVE-2023-41913
  9. CISA KEV
  10. FIRST EPSS

Frequently asked questions

Which strongSwan versions are affected by CVE-2023-41913?

strongSwan 5.3.0 to 5.9.11 when charon-tkm is the IKE daemon. NVD's range is 5.3.0 up to, but excluding, 5.9.12, and strongSwan 5.9.12 fixes it; strongSwan also publishes patches for older releases (per the strongSwan advisory and NVD).

Does CVE-2023-41913 affect routers that run the normal charon daemon?

No. strongSwan says setups that do not use charon-tkm as the IKE daemon are not vulnerable. On 2026-11-18 the OpenWrt, Buildroot and meta-openembedded strongSwan recipes offer no charon-tkm option, so images built from them lack the vulnerable code even when the version is in NVD's range.

Why does a scanner flag CVE-2023-41913 on an OpenWrt 23.05 image?

The openwrt-23.05 packages branch builds strongSwan 5.9.11, inside NVD's version range, and NVD's CPE does not separate charon-tkm from charon. If the image has no charon-tkm binary, record the CVE as not affected in a VEX statement.

Is CVE-2023-41913 in the CISA KEV catalog?

No, not as of 2026-11-18 (catalog version 2026.11.17). FIRST EPSS gives it 0.0229, the 84th percentile, in the 2026-11-17 dataset (per CISA KEV and FIRST EPSS).