{
  "id": "security/javascript/fb55__domutils/2026-10-05-removesubsets-excessive-cpu",
  "title": "Many nodes from deeply nested or wide documents cause excessive CPU use in removeSubsets()",
  "category": "security",
  "type": "dos",
  "severity": "high",
  "cvss": {
    "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
    "score": 7.5
  },
  "ecosystem": "javascript",
  "project": {
    "owner": "fb55",
    "repo": "domutils",
    "url": "https://github.com/fb55/domutils"
  },
  "affected_versions": [
    "domutils >= 1.3.0, <= 4.0.2"
  ],
  "fixed_version": "4.1.0",
  "status": "published",
  "disclosure": {
    "channel": "pvr",
    "ghsa_id": "GHSA-42h4-gpjh-8xhf",
    "cve_id": null,
    "url": "https://github.com/fb55/domutils/security/advisories/GHSA-42h4-gpjh-8xhf",
    "reported_at": "2026-10-05T14:40:15+03:00",
    "published_at": "2026-12-03T14:53:32+03:00"
  },
  "summary": "Applications that pass many nodes of untrusted HTML or XML documents to domutils' removeSubsets() are affected (CWE-407). css-select calls it on the context nodes whenever a query is given an array of roots, such as selectAll(query, nodes) and cheerio's .find(). For each node, removeSubsets() searched the whole array for the node and for each of its ancestors, and removed nodes with splice(), so its running time grew with the square of the number of nodes, times their depth. npm package domutils versions >= 1.3.0 and <= 4.0.2 are affected. Fixed in 4.1.0. There is no fix for domutils 3.x. GitHub rates it high, with CVSS 3.1 score 7.5. The advisory credits ucsurf as reporter. The repository fix includes pull request 2313 by zhangj23, merged on 2026-10-10, and is in 4.1.0.",
  "discovered_at": "2026-10-04T00:00:00+03:00",
  "public": true,
  "credit": "ucsurf",
  "updated_at": "2026-12-03T14:53:32+03:00",
  "pr": null,
  "references": [
    "https://github.com/fb55/domutils/pull/2313",
    "https://github.com/fb55/domutils/releases/tag/v4.1.0",
    "https://www.npmjs.com/package/domutils/v/4.1.0"
  ]
}
