CVE-2017-10686
High · 7.8CVSS
7.8
EPSS
2.9%
Published
Jun 29, 2017
CISA due date
—
Cloudanix analysis
A memory-handling bug in an assembler tool used by some Java packages could let attackers run their own code on affected computers if they can feed it specially made files.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Full Compromise
- Component
- Application
- Class
- Use After Free
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Multiple heap use-after-free conditions in NASM token() allocation and detoken()/pp_getline() freeing, enabling corrupted double-linked lists, double-free, out-of-bounds writes, and potential remote code execution when processing crafted input.
Why it matters to the business
Attackers could achieve arbitrary code execution on developer or build systems that invoke the vulnerable assembler, risking supply-chain compromise for any software built with affected packages; the issue affects many downstream OpenJDK distributions despite low current exploit probability.
How an attack unfolds
An attacker supplies a malicious assembly source file to NASM; the token heap buffer is freed during preprocessing and then reused in delete_Token or later detoken calls, corrupting memory structures to achieve code execution without authentication.
How to fix it
Upgrade all listed packages to the fixed versions: openjdk-17 (Chainguard/Wolfi) 17.0.5.8-r4 and equivalent fixed builds for dbg, default-jdk, default-jvm, demos, doc, jmods, jre, and jre-base variants.
How to confirm the fix worked
Confirm package versions match or exceed 17.0.5.8-r4 on Chainguard and Wolfi systems; re-run NASM on known triggering inputs and verify absence of heap corruption in sanitized builds.
Typical attack path
- Identify or induce use of NASM on untrusted .asm input
- Craft input that triggers repeated token allocation/free cycles
- Trigger use-after-free paths in detoken or delete_Token to corrupt heap metadata
- Leverage resulting OOB write or double-free for arbitrary code execution
How to detect it
Review build logs and process execution history for NASM invocations on untrusted sources; look for heap-related crashes or sanitizer reports referencing token or detoken functions.
What your security team should do
- Immediately update all affected OpenJDK packages to 17.0.5.8-r4 or later
- Scan build pipelines and developer workstations for older NASM versions
- Restrict NASM execution to trusted inputs until patches are deployed
The record
In Netwide Assembler (NASM) 2.14rc0, there are multiple heap use after free vulnerabilities in the tool nasm. The related heap is allocated in the token() function and freed in the detoken() function (called by pp_getline()) - it is used again at multiple positions later that could cause multiple damages. For example, it causes a corrupted double-linked list in detoken(), a double free or corruption in delete_Token(), and an out-of-bounds write in detoken(). It has a high possibility to lead to a remote code execution attack.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | nasm | 0 | 2.13.02-0.1 |
| Debian:12 | nasm | 0 | 2.13.02-0.1 |
| Debian:13 | nasm | 0 | 2.13.02-0.1 |
| Debian:7 | nasm | 0 | 2.10.01-1+deb7u1 |
| Mageia:5 | nasm | 0 | 2.11.07-2.1.mga5 |
| Mageia:6 | nasm | 0 | 2.12.02-1.1.mga6 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | MozillaFirefox | 0 | 68.2.0-78.51.4 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | MozillaFirefox-branding-SLED | 0 | 68-21.9.8 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | firefox-atk | 0 | 2.26.1-2.8.4 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | firefox-cairo | 0 | 1.15.10-2.13.4 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | firefox-gdk-pixbuf | 0 | 2.36.11-2.8.4 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | firefox-glib2 | 0 | 2.54.3-2.14.7 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | firefox-gtk3 | 0 | 3.10.9-2.15.3 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | firefox-harfbuzz | 0 | 1.7.5-2.7.4 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | firefox-libffi | 0 | 3.2.1.git259-2.3.3 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | firefox-libffi-gcc5 | 0 | 5.3.1+r233831-14.1 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | firefox-pango | 0 | 1.40.14-2.7.4 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | mozilla-nspr | 0 | 4.21-29.6.1 |
| SUSE:Linux Enterprise Server 11 SP4-LTSS | mozilla-nss | 0 | 3.45-38.9.3 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | nasm | 0 | 2.03.90-2.3.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP2 | nasm | 0 | 2.10.09-4.5.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP3 | nasm | 0 | 2.10.09-4.5.1 |
| Ubuntu:14.04:LTS | nasm | 0 | 2.10.09-1ubuntu0.1 |
| Ubuntu:16.04:LTS | nasm | 0 | 2.11.08-1ubuntu0.1 |
| Ubuntu:18.04:LTS | nasm | 0 | 2.13.02-0.1 |
| nuget | nasm | 2.14 | No fix |
Related vulnerabilities
- CVE-2008-2719 Off-by-one error in the ppscan function (preproc.c) in Netwide Assembler (NASM) 2.02… Also affects nasm
- CVE-2004-1287 Buffer overflow in the error function in preproc.c for NASM 0.98.38 1.2 allows attackers… Also affects nasm
- CVE-2022-28289 Mozilla developers and community members Nika Layzell, Andrew McCreight, Gabriele Svelto… Also affects MozillaFirefox
- CVE-2022-28285 When generating the assembly code for MLoadTypedArrayElementHole, an incorrect AliasSet… Also affects MozillaFirefox
- CVE-2022-28286 Due to a layout change, iframe contents could have been rendered outside of its border. Also affects MozillaFirefox
- CVE-2022-28282 By using a link with rel="localization" a use-after-free could have been triggered by… Also affects MozillaFirefox
- CVE-2022-28281 If a compromised content process sent an unexpected number of WebAuthN Extensions in a… Also affects MozillaFirefox
- CVE-2022-26485 Removing an XSLT parameter during processing could have lead to an exploitable… Also affects MozillaFirefox