Update dependency sanitize-html to v2.17.5 [SECURITY] - #1018
Open
renovate[bot] wants to merge 1 commit into
Open
Update dependency sanitize-html to v2.17.5 [SECURITY]#1018renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
✅ Deploy Preview for ember-api-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.17.1→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
v2.17.4Compare Source
Changes
sanitize-htmlandlaundernow share a single implementation ofnaughtyHref, based on that which previously existed insanitize-html.Security
v2.17.3Compare Source
Security
optiontags. There was no vulnerability when not explicitly allowingoptiontags.v2.17.2Compare Source
Changes
htmlparser2from 8.x to 10.1.0. This improves security by correctly decoding zero-padded numeric character references (e.g.,&#​0000001) that previously bypassedjavascript:URL detection. Also fixes double-encoding of entities inside raw text elements liketextareaandoption.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ 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 was generated by Mend Renovate. View the repository job log.