cbcvebase.
CVE-2016-2819
published 2016-06-13

CVE-2016-2819: Heap-based buffer overflow in Mozilla Firefox before 47.0 and Firefox ESR 45.x before 45.2 allows remote attackers to execute arbitrary code via…

PriorityP264high8.8CVSS 3.0
AVNACLPRNUIRSUCHIHAH
EXPLOIT
EPSS
24.04%
97.6th percentile
Heap-based buffer overflow in Mozilla Firefox before 47.0 and Firefox ESR 45.x before 45.2 allows remote attackers to execute arbitrary code via foreign-context HTML5 fragments, as demonstrated by fragments within an SVG element.

Affected

15 ranges
VendorProductVersion rangeFixed in
canonicalubuntu_linux
canonicalubuntu_linux
canonicalubuntu_linux
canonicalubuntu_linux
debiandebian_linux
debianfirefox< firefox 47.0-1 (sid)firefox 47.0-1 (sid)
debianfirefox-esr< firefox 47.0-1 (sid)firefox 47.0-1 (sid)
mozillafirefox<= 46.0.1
mozillafirefox
mozillafirefox
mozillafirefox>= 0 < 47.0+build3-0ubuntu0.14.04.147.0+build3-0ubuntu0.14.04.1
mozillafirefox>= 0 < 47.0+build3-0ubuntu0.16.04.147.0+build3-0ubuntu0.16.04.1
opensuseleap
opensuseopensuse
opensuseopensuse

Detection & IOCsextracted from sources · hover to see the quote

commanddocument.getElementById('BBBB').outerHTML = 'hr {}'
  • The exploit triggers the CVE-2016-2819 heap overflow by setting outerHTML to an HTML5 fragment (e.g., CSS rule string) on a DOM element, causing a buffer overflow when parsing foreign-context HTML5 fragments under an SVG node.
  • The exploit uses ASM.JS JIT-spray to place attacker-controlled shellcode at a predictable address (0x20200b58) by spraying 0x1000 asm.js float constant pool regions, bypassing ASLR and DEP on 32-bit Windows Firefox.
  • The asm.js JIT-spray embeds msfvenom windows/exec CMD=calc.exe shellcode encoded as IEEE 754 double-precision float constants within an asm.js module's FFI call, which are then JIT-compiled into executable memory at a predictable address.
  • The exploit sprays fake Node objects at heap address 0x5a500000 to gain EIP control, then redirects execution to the JIT-sprayed shellcode at 0x20200b58. Monitor for large heap spray loops targeting fixed addresses in JavaScript.
  • The vulnerability is triggered via foreign-context HTML5 fragment parsing (e.g., innerHTML/outerHTML assignment within or adjacent to SVG elements). Monitor for DOM manipulation patterns setting outerHTML/innerHTML on SVG-context elements with CSS or HTML5 content.
  • On Windows, asm.js JIT-spray causes repeated VirtualAlloc calls (PAGE_READWRITE) followed by VirtualProtect to PAGE_EXECUTE_READ for each module instantiation. Monitoring for a high volume of VirtualAlloc/VirtualProtect transitions from the Firefox renderer process is a host-based detection signal.
  • The asm.js JIT-spray technique hides shellcode opcodes within 4-byte integer or float constants passed to FFI calls or stored to heap arrays, exploiting the lack of constant blinding in Firefox's asm.js JIT. Detection: look for asm.js modules with large numbers of repeated near-identical float/integer constants.
  • The vulnerability was reported by researcher 'firehack' and is tracked as MFSA 2016-50. Affected versions are Firefox < 47.0 and Firefox ESR 45.x < 45.2.
  • ·The JIT-spray shellcode addresses (0x20200b58 for EIP, 0x5a500000 for fake node spray) are specific to Firefox 46.0.1 on 32-bit Windows. These hardcoded addresses will differ across Firefox versions, OS versions, and architectures.
  • ·The asm.js JIT-spray technique is confirmed for 32-bit (x86) Firefox on Windows. The researcher notes Linux requires more modules due to 4KB mmap granularity, and 64-bit Firefox impact was not fully investigated.
  • ·The exploit PoC from exploit-db targets Firefox 46.0.1 specifically. CVE-2016-2819 is fixed in Firefox 47.0 and Firefox ESR 45.2; the JIT-spray bypass technique (lack of constant blinding, no exec quota) is a separate but co-exploited weakness.

CVSS provenance

nvdv3.08.8HIGHCVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
nvdv2.06.8MEDIUMAV:N/AC:M/Au:N/C:P/I:P/A:P
osv8.8HIGH
vendor_debian8.8HIGH
vendor_redhat8.8HIGH
vendor_ubuntu8.8HIGH
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.