#1133377 nasm: CVE-2026-6069

Package:
src:nasm
Source:
src:nasm
Submitter:
Salvatore Bonaccorso
Date:
2026-11-03 04:27:01 UTC
Severity:
normal
Tags:
#1133377#5
Date:
2026-04-12 15:21:25 UTC
From:
To:
Hi,

The following vulnerability was published for nasm.

CVE-2026-6069[0]:
| NASM’s disasm() function contains a stack based buffer overflow when
| formatting disassembly output, allowing an attacker triggered out-
| of-bounds write when `slen` exceeds the buffer capacity.


If you fix the vulnerability please also make sure to include the
CVE (Common Vulnerabilities & Exposures) id in your changelog entry.

For further information see:

[0] https://security-tracker.debian.org/tracker/CVE-2026-6069
https://www.cve.org/CVERecord?id=CVE-2026-6069
[1] https://github.com/netwide-assembler/nasm/issues/217

Please adjust the affected versions in the BTS as needed.

Regards,
Salvatore

#1133377#12
Date:
2026-11-03 04:24:36 UTC
From:
To:
Hi,

For the record, since trixie is marked "postponed (revisit when fixed
upstream)":

Upstream issue #217 was closed on 2026-06-27 without a code change:
https://www.google.com/url?q=https://github.com/netwide-assembler/nasm/issues/217&source=gmail&ust=1793766276822000&sa=E
The reporter agreed in the thread that the maximum possible disasm()
output is 247 bytes. That is less than the 256-byte outbuf that ndisasm
passes in (disasm/ndisasm.c: char outbuf[256]; disasm(q, INSN_MAX, outbuf,
sizeof(outbuf), ...)). So the "slen += snprintf(output + slen,
outbufsize - slen, ...)" pattern never reaches truncation in the current
code. The upstream maintainer (hpax) wrote: "I agree this should be
cleaned up, but it is not a problem yet..."

I tried to confirm this empirically on the Debian 3.01-1 source. I built
ndisasm with -fsanitize=address and disassembled 20 MB of /dev/urandom in
each mode:
-b 16: 9842187 instructions, longest output line 84 chars, 0 ASan reports
-b 32: 8197566 instructions, longest output line 92 chars, 0 ASan reports
-b 64: 7950780 instructions, longest output line 99 chars, 0 ASan reports
(Line length includes the address and hex-bytes columns, so the disasm()
text itself is shorter still.)

So there's no reachable overflow with the in-tree caller. The pattern
would only matter for a hypothetical caller passing a smaller buffer.
That probably makes this <unimportant> rather than something to wait on
upstream for, but that's of course the security team's call.

Thanks!