Update npm package sanitize-html to v2.17.5 [SECURITY] - #9136
Update npm package sanitize-html to v2.17.5 [SECURITY]#9136hash-worker[bot] wants to merge 1 commit into
sanitize-html to v2.17.5 [SECURITY]#9136Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
PR SummaryLow Risk Overview 2.17.5 addresses CVE-2026-53606: URI scheme checks now cover more attributes (e.g. Reviewed by Cursor Bugbot for commit 0de0ed5. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0de0ed5. Configure here.
| "pdf2json": "3.2.0", | ||
| "puppeteer-core": "22.15.0", | ||
| "sanitize-html": "2.17.4", | ||
| "sanitize-html": "2.17.5", |
There was a problem hiding this comment.
Lockfile omits security upgrade
High Severity
package.json bumps sanitize-html to 2.17.5, but yarn.lock still resolves and pins sanitize-html@2.17.4. With Yarn’s --immutable installs, CI will reject the mismatch; if installs are forced through, the CVE-2026-53606 fix never lands and the vulnerable package remains in use.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0de0ed5. Configure here.


This PR contains the following updates:
2.17.4→2.17.5sanitize-html has incomplete URI scheme validation in that allows javascript: URIs through action, formaction, data, poster, and background attributes
CVE-2026-53606 / GHSA-vccv-cmxp-4j9h
More information
Details
Summary
sanitize-html uses
allowedSchemesAppliedToAttributes(default:['href', 'src', 'cite']) to gate thenaughtyHref()function that blocks dangerous URI schemes likejavascript:andvbscript:. The HTML specification defines 10+ attributes that accept URIs (action,formaction,data,poster,background,ping,xlink:href,dynsrc,lowsrc), but none of these are included in the default gate list. When a developer allows any of these attributes in their configuration,javascript:URIs pass through completely unmodified, enabling XSS.The library has zero awareness of these URI-bearing attributes — none appear anywhere in the 854-line source file (verified by grep). No warning mechanism exists, and the README provides no security guidance about expanding
allowedSchemesAppliedToAttributeswhen allowing form or media attributes.Severity
Exploitation requires non-default configuration: the developer must explicitly allow a non-default tag (e.g.,
form) AND a non-default attribute (e.g.,action). Default configuration is NOT vulnerable. However, this is a common configuration pattern for CMS platforms, form builders, and rich content editors.Affected Versions
All versions of sanitize-html from v1.18.0 (which introduced
allowedSchemesAppliedToAttributes) through at least v2.17.2. The default list has been['href', 'src', 'cite']since introduction and has never been expanded.Root Cause
File:
index.js:329(sanitize-html 2.10.0, confirmed same in 2.17.x)Default list at line 829:
The
naughtyHref()function (lines 627-667) correctly blocksjavascript:,vbscript:, and other dangerous schemes. However, it has exactly 2 call sites in the entire codebase (lines 330 and 395), both inside theindexOfgate. There is no ungated path.When attribute name is
action,formaction,data,poster,background, etc.:indexOf('action')returns-1ifblock is skipped entirelynaughtyHref()is never calledjavascript:alert(1)passes through unmodifiedThe
escapeHtml()function at line 464 provides no defense — it only encodes& < > "characters, which are not present injavascript:alert(1).Data Flow:
Steps to Reproduce
Observed behavior:
javascript:preserved onaction/formaction/databut correctly stripped onhref.Expected behavior:
javascript:should be stripped on ALL URI-bearing attributes, or at minimum, the library should warn developers when they allow URI-bearing attributes not covered by scheme validation.Impact
An attacker can achieve XSS in applications that use sanitize-html with non-default configurations allowing URI-bearing attributes:
<form action="javascript:...">— XSS on form submission (all modern browsers)<button formaction="javascript:...">— per-button XSS override (all modern browsers)<object data="javascript:...">— object load XSS (Chrome, Firefox)<video poster="javascript:...">— limited browser support but spec-validCommon vulnerable configurations:
Mitigating factors:
form-actiondirective mitigates form-based vectorsallowedSchemesAppliedToAttributesRemediation
Option 1 (Recommended): Expand the default
allowedSchemesAppliedToAttributeslist:Option 2: Apply
naughtyHref()to ALL attributes by default (invert the gate logic).Option 3: Add a runtime warning when developers allow URI-bearing attributes not in
allowedSchemesAppliedToAttributes(analogous tovulnerableTagswarning forscript/styleat lines 124-129).Reporter
Kevin Lee (Changseon Lee)
OPCIA Corp. / PeanutAI Inc.
Seoul, South Korea
GitHub: crattack
Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
apostrophecms/apostrophe (sanitize-html)
v2.17.5Compare Source
Security
javascript:and similar. None of these are used in the default configuration ofsanitize-htmlorapostropheor likely to be used there, and some attributes, like anactionfor aform, are inherently unsafe to allow if XSS protection is your goal. Nevertheless it makes sense to block certain URL types where they are not appropriate. Some attributes are not supported at all by modern browsers but are included for completeness. Thanks to crattack for reporting the vulnerability.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.