chore(deps): update dependency sanitize-html to v2.17.4 [security]#863
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update dependency sanitize-html to v2.17.4 [security]#863renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
7fe6f55 to
7dd61fa
Compare
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
7dd61fa to
6d6b249
Compare
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.3→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 OSV and 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
Configuration
📅 Schedule: (in timezone America/New_York)
* * * * 1-5)🚦 Automerge: Enabled.
♻ 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.