Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2025-39946 PoC — tls: make sure to abort the stream if headers are bogus

Source
Associated Vulnerability
Title:tls: make sure to abort the stream if headers are bogus (CVE-2025-39946)
Description:In the Linux kernel, the following vulnerability has been resolved: tls: make sure to abort the stream if headers are bogus Normally we wait for the socket to buffer up the whole record before we service it. If the socket has a tiny buffer, however, we read out the data sooner, to prevent connection stalls. Make sure that we abort the connection when we find out late that the record is actually invalid. Retrying the parsing is fine in itself but since we copy some more data each time before we parse we can overflow the allocated skb space. Constructing a scenario in which we're under pressure without enough data in the socket to parse the length upfront is quite hard. syzbot figured out a way to do this by serving us the header in small OOB sends, and then filling in the recvbuf with a large normal send. Make sure that tls_rx_msg_size() aborts strp, if we reach an invalid record there's really no way to recover.
Description
Exploit for CVE-2025-39946, a bug in the Linux kernel's net/tls subsystem.
Readme
# README

This is an exploit for CVE-2025-39946. It will work on the `lts-6.12.48` kCTF instance (but not 100% reliable).

I wrote a blog post analysing this vulnerability in detail. [Check it out here](https://faith2dxy.xyz/2025-10-02/kCTF-TLS-nday-analysis/)!

# Adapting for other kernel versions

The only modification the exploit should need to work for other kernel versions is a change to the `CORE_PATTERN_OFFSET`. You'll have to get the target kernel's `bzImage`, load the kernel with root privs, and compare `core_pattern`'s address with `_text`'s address in `/proc/kallsyms`.

I don't think any other changes will be necessary to adapt the exploit for other versions.
File Snapshot

[4.0K] /data/pocs/587d975541073b8c8d63472d527c6d8cfb312b42 ├── [9.8K] exploit.c ├── [ 39] Makefile └── [ 679] README.md 1 directory, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →