fix(deps): update dependency sanitize-html to v2.17.4 [security]#2140
Open
renovate[bot] wants to merge 1 commit into
Open
fix(deps): update dependency sanitize-html to v2.17.4 [security]#2140renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
|
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.15.0→2.17.4Apostrophe has default XSS via
xmpraw-text passthrough insanitize-htmlCVE-2026-44990 / GHSA-rpr9-rxv7-x643
More information
Details
Summary
Under the default configuration,
sanitize-htmlcan turn attacker-controlled content inside a disallowedxmpelement into live HTML or JavaScript. This is a sanitizer bypass in the defaultdisallowedTagsMode: 'discard'path and can lead to stored XSS in applications that render sanitized output back to users.Details
In
sanitize-html@2.17.3, the defaultnonTextTagslist includes onlyscript,style,textarea, andoptioninindex.jslines 138-142. That means disallowedxmptags are not treated as "drop the entire contents" tags.Later, in the
ontexthandler atindex.jslines 569-577, the code special-casestextareaandxmpand appends their text content directly to the output without escaping:Because
htmlparser2treatsxmpas a raw-text element, markup insidexmpis parsed as text on input but becomes live markup again once it is appended unescaped to the sanitized output.This creates a default sanitizer bypass. For example, a disallowed
<xmp>wrapper can be used to smuggle<script>or event-handler payloads through sanitization.The README also appears to contradict the implementation. In the "Discarding the entire contents of a disallowed tag" section, the documented exception list names only
style,script,textarea, andoption, and does not mentionxmp.PoC
Tested locally against
sanitize-html@2.17.3on Node.jsv25.2.1.sanitize-htmloutput, for example:If
cleanis inserted into the DOM or stored and later rendered as trusted HTML, the attacker-controlled script executes.Impact
This is a cross-site scripting vulnerability in the default sanitizer behavior. Any application that uses
sanitize-htmldefaults and then renders the returned HTML as trusted output is impacted. A remote attacker who can submit HTML content can trigger execution of arbitrary JavaScript in another user's browser when that content is viewed.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
apostrophecms/apostrophe (sanitize-html)
v2.17.4Changes
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.v2.17.1Compare Source
Fixes
<hello) returning empty string inescapeandrecursiveEscapemodes. Fixes #706.Thanks to Byeong Hyeon for the fix.
v2.17.0Compare Source
preserveEscapedAttributes, allowing attributes on escaped disallowed tags to be retained. Thanks to Ben Elliot for this new option.v2.16.0Compare Source
onOpenTagandonCloseTagevents to enable advanced filtering to hook into the parser. Thanks to Rimvydas Naktinis.Configuration
📅 Schedule: (UTC)
* 0-4,22-23 * * 1-5)* * * * 0,6)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, 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.