{
  "id": "security/javascript/fb55__domutils/2026-10-05-find-findall-quadratic-time",
  "title": "Deeply nested documents make find() and findAll() take quadratic time",
  "category": "security",
  "type": "dos",
  "severity": "medium",
  "cvss": {
    "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
    "score": 5.3
  },
  "ecosystem": "javascript",
  "project": {
    "owner": "fb55",
    "repo": "domutils",
    "url": "https://github.com/fb55/domutils"
  },
  "affected_versions": [
    "domutils >= 3.1.0, <= 4.0.2"
  ],
  "fixed_version": "4.1.0",
  "status": "published",
  "disclosure": {
    "channel": "pvr",
    "ghsa_id": "GHSA-qx47-vpjg-465w",
    "cve_id": null,
    "url": "https://github.com/fb55/domutils/security/advisories/GHSA-qx47-vpjg-465w",
    "reported_at": "2026-10-05T14:40:15+03:00",
    "published_at": "2026-12-03T14:53:28+03:00"
  },
  "summary": "Applications that search untrusted HTML or XML documents with domutils' find() or findAll(), or with the helpers built on find() (filter(), getElements(), getElementsByTagName(), getElementsByClassName() and getElementsByTagType()), are affected (CWE-407). These functions kept the child lists still to be searched on a stack that they grew and shrank at its front with unshift() and shift(), which moves every entry already on it, so searching a deeply nested document took time quadratic in its depth. npm package domutils versions >= 3.1.0 and <= 4.0.2 are affected: getElementsByClassName() from 3.2.0, and the other functions from 3.1.0. Fixed in 4.1.0. GitHub rates it medium, with CVSS 3.1 score 5.3. The advisory credits ucsurf as reporter. Fixed by Felix Boehm (@fb55).",
  "discovered_at": "2026-10-04T00:00:00+03:00",
  "public": true,
  "credit": "ucsurf",
  "updated_at": "2026-12-03T14:53:28+03:00",
  "pr": null,
  "references": [
    "https://github.com/fb55/domutils/pull/2406",
    "https://github.com/fb55/domutils/releases/tag/v4.1.0",
    "https://www.npmjs.com/package/domutils/v/4.1.0"
  ]
}
