
Weaponized proof-of-concept for CVE-2026-121994: a fake GDB remote debug stub that sends a malicious p-packet to trigger memory corruption and a reverse shell.

exploit.py - a fake debug stub "server" that listens for a connection and sends a malicious p-packet on the first p-request
build.sh - build script that builds gdb without protections in a linux environment
gdb-18.1.tar.gz - gdb source used in build.sh
stacker.py - tool used to recreate all stack contents in the malicious p-packet before overwriting the instruction pointer
stack.txt - example of a copied stack from gdb; for use in stacker.py
vuln.c - commented section of the vulnerable function in gdb pointing out the vulnerability
gdb_cve.gif - demonstration of the POC running
On 2026-11-03 CVE-2026-121994 was released detailing a vulnerability in GDB when connecting to untrusted remote debug servers. This POC exploit was built shortly after to demonstrate the vulnerability. While this is a weaponized POC that includes a functional reverse shell, it is not thoroughly hardened, meaning it currently only works on gdb compiled with no protections.
To mitigate risk, it is recommended that you do not connect to untrusted remote gdb debug stubs / servers.
https://bugzilla.redhat.com/show_bug.cgi?id=2565676
https://shell-storm.org/shellcode/files/shellcode-857.html
https://github.com/pyocd/pyocd
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Remote-Protocol.html
https://ftp.gnu.org/gnu/gdb/
https://developers.redhat.com/blog/2015/04/28/remote-debugging-with-gdb
Multiple google searches were made to resolve simple issues like how to build gdb with no protections.