Skip to content

deps(deps): bump sanitize-html from 2.18.1 to 2.18.2 - #570

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/sanitize-html-2.18.2
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/sanitize-html-2.18.2

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 16, 2026

Copy link
Copy Markdown
Contributor

Bumps sanitize-html from 2.18.1 to 2.18.2.

Changelog

Sourced from sanitize-html's changelog.

2.18.2 (2026-11-11)

Fixes

  • With parser.decodeEntities: false, named entities longer than 20 characters, such as &CounterClockwiseContourIntegral;, are no longer double-encoded. Thanks to Kenny for the contribution.

Security

  • Outside SVG and MathML, browsers parse <![CDATA[ as a bogus comment that ends at the first >, but the underlying parser read it all the way to ]]>. Markup between those two points was hidden from sanitize-html, so a start tag for one of the nonTextTags (such as noscript, style, script, textarea or xmp) placed there was not seen, and content the browser would keep inert inside that element was emitted as live markup. Only tags, attributes and URL schemes permitted by the allowlist could be emitted this way. A <![CDATA[ section now always ends at the first >, as it does in HTML content in a browser. As a result, the text of a real CDATA section inside SVG or MathML is now dropped or sanitized as markup instead of being kept as text, and the literal sequence <![CDATA[ inside an allowed script or style element is written as <!&[#91](https://github.com/apostrophecms/apostrophe/tree/HEAD/packages/sanitize-html/issues/91);CDATA[ (CWE-79, CWE-436, GHSA-2rjc-9xvg-45j7).

    Thanks to Oscar Rodríguez for reporting the vulnerability.

  • The check that drops SVG animation elements (animate, animateColor, animateMotion, animateTransform, set) when they retarget a URL attribute such as href took only the part of attributeName after its last colon as the target. Browsers split a name with more than one colon differently, and current Chrome resolves a spelling such as xlink:href:x to xlink:href, so the animation was kept and could retarget a link to a javascript: URL after sanitization. Every colon-separated part of attributeName, and of the element name, is now matched. The default configuration is not affected: it only applies when animation elements are allowed together with attributeName and an animation value attribute such as values or to (CWE-79, CWE-184, GHSA-8g6g-w2rq-xcmc).

    Thanks to Zachariah Mithani for reporting the vulnerability.

  • When style was allowed, the content of a <style> element inside svg or math could be emitted as live markup, even when svg and math themselves were not allowed. The underlying parser and browsers do not always agree on whether such a <style> is an HTML element, whose content is raw CSS text, or an SVG/MathML element, whose content is markup: for example a <style> inside MathML annotation-xml without an HTML encoding is a MathML element to a browser but raw text to the parser, and inside svg or math the parser decodes &lt; in its content. Because sanitize-html emitted style content as is, markup that the allowlist never permitted, including event handler attributes, could reach the browser. Inside svg or math, a < in style content is now written as the equivalent CSS escape \3c , which means the same in a stylesheet and cannot open a tag. Other stylesheets are unchanged. Exposure is limited: style is not allowed by default, it is one of the vulnerableTags that sanitize-html warns about unless allowVulnerableTags is set, and allowing it already permits CSS-based attacks (CWE-79, GHSA-6wrv-5cp6-h3c5).

    Thanks to Ali Mustafa for reporting the vulnerability.

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [sanitize-html](https://github.com/apostrophecms/apostrophe/tree/HEAD/packages/sanitize-html) from 2.18.1 to 2.18.2.
- [Changelog](https://github.com/apostrophecms/apostrophe/blob/sanitize-html@2.18.2/packages/sanitize-html/CHANGELOG.md)
- [Commits](https://github.com/apostrophecms/apostrophe/commits/sanitize-html@2.18.2/packages/sanitize-html)

---
updated-dependencies:
- dependency-name: sanitize-html
  dependency-version: 2.18.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot @github

dependabot Bot commented on behalf of github Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Labels

The following labels could not be found: automated, dependencies. Please create them before Dependabot can add them to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant