# CVE-2026-145158: domutils 1.5.0 before 4.1.0 Denial of Service via compareDocumentPosition()

Source: https://aplosec.si/cve/CVE-2026-145158/

[AploSec](https://aplosec.si/) / [Disclosures](https://aplosec.si/disclosures/) / CVE-2026-145158

Medium 6.9 · Reported · Fixed in 4.1.0 · CWE-407 · Multiple credited contributors · npm

# domutils 1.5.0 before 4.1.0 Denial of Service via compareDocumentPosition()

CVE-2026-145158 · published 2026-12-04

In plain words: this type of bug lets someone slow down or crash the service with crafted input (denial of service). A fixed release is listed.

## Summary

CVE-2026-145158 affects domutils (npm) 1.5.0 to < 4.1.0: Denial of Service via compareDocumentPosition() (CWE-407). Fixed in 4.1.0. CVSS 4.0 base score 6.9 (Medium), assigned by VulnCheck. Published 2026-12-04 by VulnCheck. Credit: Zachariah Mithani (AploSec), ucsurf.

domutils 1.5.0 before 4.1.0 contains a denial of service vulnerability in compareDocumentPosition() that takes quadratic time when building ancestor chains with unshift(). Attackers can supply HTML or XML documents with deeply nested elements that applications compare or sort via uniqueSort() to block the Node.js event loop.

## Evidence

Reported to the maintainer. The public advisory and references below describe the evidence and preconditions; reporting status alone does not establish independent reproduction.

## Remediation

Upgrade domutils to 4.1.0 or later. Releases in the affected range (1.5.0 to < 4.1.0) are vulnerable. See the linked advisory for details on affected release lines.

## Timeline

- 2026-12-04 CVE published

## References

- [Referencehttps://github.com/fb55/domutils/security/advisories/GHSA-pvqx-4ghw-x6gp](https://github.com/fb55/domutils/security/advisories/GHSA-pvqx-4ghw-x6gp)

- [VulnCheck advisoryhttps://www.vulncheck.com/advisories/domutils-1.5.0-before-4.1.0-denial-of-service-via-comparedocumentposition](https://www.vulncheck.com/advisories/domutils-1.5.0-before-4.1.0-denial-of-service-via-comparedocumentposition)

- [Fix commithttps://github.com/fb55/domutils/commit/560a8d1886b8ac28872432b3bb368c19930a6c8f](https://github.com/fb55/domutils/commit/560a8d1886b8ac28872432b3bb368c19930a6c8f)

- [Releasehttps://github.com/fb55/domutils/releases/tag/v4.1.0](https://github.com/fb55/domutils/releases/tag/v4.1.0)

- [Vulnerable codehttps://github.com/fb55/domutils/blob/v4.0.2/src/helpers.ts#L79-L99](https://github.com/fb55/domutils/blob/v4.0.2/src/helpers.ts#L79-L99)

- [CVE recordhttps://www.cve.org/CVERecord?id=CVE-2026-145158](https://www.cve.org/CVERecord?id=CVE-2026-145158)

- [NVD recordhttps://nvd.nist.gov/vuln/detail/CVE-2026-145158](https://nvd.nist.gov/vuln/detail/CVE-2026-145158)

**Severity:** Medium 6.9 CVSS 4.0, scored by VulnCheck in the [CVE record](https://www.cve.org/CVERecord?id=CVE-2026-145158)

**Package:** domutils

**Ecosystem:** npm

**Affected:** 1.5.0 to < 4.1.0

**Fixed:** 4.1.0

**Weakness:** CWE-407

**CNA:** VulnCheck

**Credit:** Zachariah Mithani (AploSec) finder · ucsurf finder
