Executive brief
The Netwide Assembler (NASM), a widely used tool for translating assembly code into machine-readable formats, contains a security vulnerability in its disassembly function. An attacker can provide specially crafted input that causes the software to crash or behave unpredictably by overflowing its internal memory buffers. This could lead to a denial-of-service, impacting the availability of automated build or analysis pipelines that rely on NASM.
Technical details
A stack-based buffer overflow (CWE-787) exists in the disasm() function within disasm/disasm.c of the Netwide Assembler (NASM). The vulnerability is caused by the function mixing bounded snprintf() calls with direct memory writes (e.g., memcpy and direct array indexing) that fail to validate the remaining capacity of the caller-provided output buffer. When the length of the formatted disassembly string (slen) exceeds the buffer capacity (outbufsize), an out-of-bounds write occurs, specifically at the null-termination step (output[slen] = '\0'). An attacker can exploit this by providing input that generates long disassembly strings, leading to a crash or potential memory corruption. The issue was identified in version 3.02:rc5.
Affected products
- NASM Netwide Assembler (NASM) 3.02:rc5
Timeline
- 2026-03-29: disclosed: Issue reported on NASM GitHub repository
- 2026-04-10: advisory: CVE published by CERT/CC
- 2026-04-16: other: NIST initial analysis completed