GnuPG RCE bugs: memory corruption from basics to real CVEs

12 steps · about 2 h 50 min · Intermediate

  1. GNU Privacy Guard (reference, Wikipedia, 10 min)

    Start by learning what GnuPG is and what it does, so the bugs have context.

  2. GPG-AGENT(1) (doc, GnuPG project, 10 min)

    The official docs show that gpg-agent is a separate daemon that manages private keys, and that gpg and gpgsm call it.

  3. Arbitrary code execution (reference, Wikipedia, 10 min)

    It defines arbitrary code execution and RCE, and the vocabulary used in advisories.

  4. Buffer Overflow (article, OWASP, 10 min)

    OWASP explains why C and C++ code that doesn't check bounds can overwrite adjacent memory.

  5. Buffer Overflow Explained: How the Attack Works (2026) (article, HackerDNA, 15 min)

    It compares stack, heap and integer-overflow variants, which you will meet in the GnuPG cases.

  6. Buffer Overflow Exploit (tutorial, Dhaval Kapil, 30 min)

    A hands-on walk through the stack and return address, showing how an overflow redirects execution.

  7. Stack Smashing: Rebuilding a Classic Buffer Overflow Exploit in C (video, YouTube, 25 min)

    A recent video that rebuilds a classic exploit from scratch, so you can see the earlier concepts run.

  8. AddressSanitizer Tutorial 1 - Understanding the output (Stack Overflow) (video, YouTube, 15 min)

    It shows how developers detect these bugs with AddressSanitizer.

  9. Memory corruption (reference, Wikipedia, 10 min)

    It puts overflows alongside use-after-free and double-free, the other bug classes behind GnuPG's past CVEs.

  10. A critical GnuPG security update (article, LWN.net, 10 min)

    A real case: an oversized wrapped session key causes a stack overflow in gpg-agent.

  11. Memory Corruption in ASCII-Armor Parsing (article, gpg.fail, 20 min)

    The researchers' own write-up of the armor parser bug, showing how one broken size assumption spreads corruption through the program.

  12. GnuPG: Arbitrary Code Execution (GLSA 202512-01) (article, Gentoo Security, 5 min)

    It shows how a security advisory states impact, affected versions and the fix, so you can practise reading one.