cbcvebase.
CVE-2016-1960
published 2016-03-13

CVE-2016-1960: Integer underflow in the nsHtml5TreeBuilder class in the HTML5 string parser in Mozilla Firefox before 45.0 and Firefox ESR 38.x before 38.7 allows remote…

PriorityP260high8.8CVSS 3.0
AVNACLPRNUIRSUCHIHAH
EXPLOIT
EPSS
30.95%
98.1th percentile
Integer underflow in the nsHtml5TreeBuilder class in the HTML5 string parser in Mozilla Firefox before 45.0 and Firefox ESR 38.x before 38.7 allows remote attackers to execute arbitrary code or cause a denial of service (use-after-free) by leveraging mishandling of end tags, as demonstrated by incorrect SVG processing, aka ZDI-CAN-3545.

Affected

29 ranges· showing 25
VendorProductVersion rangeFixed in
debianfirefox< firefox 45.0-1 (sid)firefox 45.0-1 (sid)
debianfirefox-esr< firefox 45.0-1 (sid)firefox 45.0-1 (sid)
mozillafirefox<= 44.0.2
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox
mozillafirefox>= 0 < 45.0+build2-0ubuntu0.14.04.145.0+build2-0ubuntu0.14.04.1
mozillafirefox>= 0 < 45.0.2+build1-0ubuntu0.14.04.145.0.2+build1-0ubuntu0.14.04.1
mozillafirefox>= 0 < 45.0.1+build1-0ubuntu0.14.04.245.0.1+build1-0ubuntu0.14.04.2
mozillathunderbird<= 38.6.0
mozillathunderbird>= 0 < 1:38.7.2+build1-0ubuntu0.14.04.11:38.7.2+build1-0ubuntu0.14.04.1
mozillathunderbird>= 0 < 1:38.7.2+build1-0ubuntu0.16.04.11:38.7.2+build1-0ubuntu0.16.04.1
opensuseleap
opensuseopensuse
opensuseopensuse

Detection & IOCsextracted from sources · hover to see the quote

urlhttps://ftp.mozilla.org/pub/firefox/releases/44.0.2/win32/en-US/
  • Exploit triggers via innerHTML assignment of a table containing an SVG element in a foreign fragment context — monitor for DOM mutations combining <table> and <svg> end-tag mismatches in HTML5 parser input.
  • Exploit uses a large Uint32Array heap spray (0x19000000 elements) to occupy high heap addresses for fake nsHtml5StackNode objects — anomalously large typed-array allocations in Firefox JS heap are a detection signal.
  • Exploit uses asm.js JIT-spray to place attacker-controlled shellcode at a predictable fixed address (0x3c3c1dc8 / 0xXXXX1dc8) — repeated instantiation of identical asm.js modules (0x1800 regions) is a strong indicator.
  • Exploit pivots stack to heap via xchg edi, esp gadget before calling WinExec('calc.exe') — ROP chain ending in WinExec/ShellExecute with a process name argument on the heap is a behavioral detection opportunity.
  • Exploit searches for ROP gadgets within the loaded PE text section of xul.dll and kernel32.dll at runtime — unusual memory-read patterns scanning executable sections of these DLLs from JS heap addresses may indicate exploitation.
  • Exploit overwrites vftable entries of an HTMLDivElement (entries 2 and 131) and calls elem.click() to trigger code execution — hooking or monitoring vftable pointer writes to DOM element objects can detect this technique.
  • Exploit targets Firefox versions before 45.0 and ESR before 38.7 — presence of Firefox 44.0.2 or earlier on a host should be flagged as vulnerable to CVE-2016-1960.
  • ·The nsHtml5StackNode size (0x1c bytes) is hardcoded in the exploit and may vary across Firefox builds — the exploit notes this as a sizeof estimate.
  • ·The asm.js JIT-spray technique relies on the absence of constant folding in Release builds (present in Firefox 44.0.2); Nightly builds after ~30 Nov 2016 added constant folding which partially mitigates this spray vector.

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.