Skip to main content
Vulnerability Database/CVE-2026-100505

CVE-2026-100505: Ghidra Use-After-Free Vulnerability

CVE-2026-100505 is a use-after-free flaw in Ghidra that triggers heap out-of-bounds reads when decoding multi-byte UTF characters. This article covers technical details, affected versions, impact, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-100505 Overview

CVE-2026-100505 is a heap out-of-bounds read vulnerability in the National Security Agency's Ghidra reverse engineering framework. The flaw affects Ghidra versions 9.2 through 12.1.4 and resides in the StringManager::getCodepoint function inside the decompiler. When decoding multi-byte UTF-8, UTF-16, or UTF-32 characters, the function fails to validate the remaining buffer length. Attackers can craft malicious binaries containing strings or constant byte stores that end with multi-byte lead units. Loading such a binary causes the decompiler to read past the end of the heap buffer, crashing the decompiler or leaking adjacent heap memory into decompiled output. The weakness is classified as [CWE-125] (Out-of-Bounds Read).

Critical Impact

A malicious binary analyzed in Ghidra can crash the decompiler or expose adjacent heap memory contents in decompiled output, potentially disclosing sensitive information from the reverse engineer's process memory.

Affected Products

  • Ghidra 9.2 through 12.1.4
  • Ghidra Decompiler component (stringmanage.cc)
  • Any downstream tooling bundling the vulnerable Ghidra decompiler binary

Discovery Timeline

  • 2026-09-26 - CVE-2026-100505 published to NVD
  • 2026-09-28 - Last updated in NVD database

Technical Details for CVE-2026-100505

Vulnerability Analysis

The defect lives in StringManager::getCodepoint within Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc. The function decodes codepoints from a raw byte buffer that originates from program strings or constant byte stores embedded in an analyzed binary. The pre-patch signature accepts a pointer and character size but never receives the remaining buffer length. When the final bytes of a string buffer form the lead unit of a multi-byte UTF-8, UTF-16, or UTF-32 sequence, the decoder dereferences continuation bytes that lie beyond the allocated region.

Two outcomes are possible. The decompiler process may crash on an invalid read when neighboring memory is unmapped. Alternatively, residual heap data is decoded as a Unicode codepoint and emitted into the decompiled C output, exposing memory contents that the reverse engineer never intended to see.

Root Cause

The root cause is missing bounds validation in a decoder that advances by a variable number of bytes based on the lead unit. Callers in both printlanguage.cc and stringmanage.cc passed only a cursor into the buffer, so getCodepoint had no way to clamp reads to the valid region.

Attack Vector

Exploitation requires an analyst to open a crafted binary in Ghidra and trigger decompilation. The attack vector is local and relies on user interaction, consistent with the typical reverse engineering workflow where untrusted samples are routinely loaded for analysis.

text
// Patch in Ghidra/Features/Decompiler/src/decompile/cpp/stringmanage.cc
   int4 count=0;
   int4 skip = charsize;
   while(i<size) {
-    int4 codepoint = getCodepoint(buffer+i,charsize,bigend,skip);
+    int4 codepoint = getCodepoint(buffer+i,size-i,charsize,bigend,skip);
     if (codepoint < 0) return false;
     if (codepoint == 0) break;		// Terminator
     writeUtf8(s, codepoint);

// Patch in Ghidra/Features/Decompiler/src/decompile/cpp/printlanguage.cc
   int4 skip = charsize;
   int4 codepoint = 0;
   while(i<count) {
-    codepoint = StringManager::getCodepoint(buf+i,charsize,bigend,skip);
+    codepoint = StringManager::getCodepoint(buf+i,count-i,charsize,bigend,skip);
     if (codepoint == 0 || codepoint == -1) break;
     printUnicode(s,codepoint);
     i += skip;

Source: Ghidra Commit e37c57f3 — the patch adds a size-i or count-i remaining-length argument so getCodepoint can validate the buffer before dereferencing continuation bytes.

Detection Methods for CVE-2026-100505

Indicators of Compromise

  • Unexpected decompile.exe or decompile process crashes while analyzing a sample
  • Decompiled output containing unusual Unicode strings not present in the original binary
  • Binaries with program strings or constant byte stores that terminate on a UTF-8 lead byte (0xC0–0xF7) or a lone UTF-16/UTF-32 lead unit
  • Repeated decompiler restarts in Ghidra project logs when processing a specific sample

Detection Strategies

  • Compare the installed Ghidra version against the fixed release and flag any instance at or below 12.1.4
  • Review decompilation output for anomalous Unicode sequences adjacent to otherwise ASCII strings
  • Monitor native crash dumps from the decompile helper process for signals consistent with out-of-bounds reads

Monitoring Recommendations

  • Track execution of the Ghidra decompiler child process and alert on abnormal termination codes
  • Log checksum and provenance of binaries submitted to shared Ghidra analysis environments
  • Isolate reverse engineering workstations from sensitive data stores so leaked heap bytes carry minimal residual value

How to Mitigate CVE-2026-100505

Immediate Actions Required

  • Upgrade Ghidra to a version containing commit e37c57f3d9c29511a1860f0a735df53131d403d7 or later
  • Only analyze untrusted binaries inside a dedicated virtual machine or container
  • Avoid sharing decompiled output from pre-patch Ghidra versions, as it may contain leaked heap bytes

Patch Information

The fix is tracked as GP-7251 and committed to the NSA Ghidra Repository in commit e37c57f3. The patch adds a remaining-length parameter to StringManager::getCodepoint and updates all call sites in stringmanage.cc and printlanguage.cc to pass size-i or count-i. Additional context is available in the VulnCheck Ghidra Advisory and the Ghidra Decompiler Source Code.

Workarounds

  • Run Ghidra inside a sandbox with no network egress and no sensitive data loaded in the host process
  • Restrict Ghidra project imports to binaries from trusted sources until the patched build is deployed
  • Disable automatic decompilation on import and manually review suspicious samples before invoking the decompiler
bash
# Verify installed Ghidra version against the fixed release
cat $GHIDRA_INSTALL_DIR/Ghidra/application.properties | grep application.version

# Rebuild the decompiler from a patched source tree
git clone https://github.com/NationalSecurityAgency/ghidra.git
cd ghidra
git checkout e37c57f3d9c29511a1860f0a735df53131d403d7
gradle buildNatives_linux_x86_64

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.