Bug 1472882 (CVE-2017-10686)

Summary: CVE-2017-10686 nasm: Use-after-free in the detoken() function
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: java-sig-commits, lpardo, mizdebsk, msimacek
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-07 13:40:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1472885    
Bug Blocks: 1472886, 1652048    

Description Andrej Nemec 2017-07-19 15:13:27 UTC
In Netwide Assembler (NASM), 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().

Upstream issue:

https://bugzilla.nasm.us/show_bug.cgi?id=3392414

Comment 1 Andrej Nemec 2017-07-19 15:15:50 UTC
Created nasm tracking bugs for this issue:

Affects: fedora-all [bug 1472885]

Comment 3 Stefan Cornelius 2017-08-03 10:03:36 UTC
Patch:
http://repo.or.cz/nasm.git/commit/736be08cf3ec4d1da31f350359feb8c1c782de9a
http://repo.or.cz/nasm.git/commit/f9ec5bbd2af6ff5276f1fd5ab52df4ed7b096344

Note that 736be08cf3ec4d1da31f350359feb8c1c782de9a trades a use-after-free for a memory leak. Not very elegant, but for the normal nasm use cases that I can imagine this is probably OK.

Comment 4 Stefan Cornelius 2017-08-07 13:40:46 UTC
Statement:

Red Hat Product Security has rated this issue as having Moderate security impact. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

Comment 5 Fedora Update System 2017-08-18 00:25:17 UTC
nasm-2.13.01-3.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2017-08-18 04:49:08 UTC
nasm-2.13.01-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Stefan Cornelius 2018-11-23 14:45:09 UTC
*** Bug 1652046 has been marked as a duplicate of this bug. ***