Skip to content

build(deps): bump the npm-security group across 2 directories with 2 updates - #148

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/npm-security-030f375cc7
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/npm-security-030f375cc7

Conversation

@dependabot

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

Copy link
Copy Markdown
Contributor

Bumps the npm-security group with 2 updates in the / directory: handlebars and sanitize-html.
Bumps the npm-security group with 1 update in the /docs directory: sanitize-html.

Updates handlebars from 4.7.9 to 4.7.10

Release notes

Sourced from handlebars's releases.

v4.7.10

  • security: Sanitize the source map URL when minifying - f37c599
  • security: Iterate lazily in #each and strip whitespace in linear time - 812c226
  • security: Escape <!-- and <script in precompiled output - 609d1b1 GHSA-xw65-4hp5-5hc7
  • security: Don't trust special properties on context data - ceec388 GHSA-p8wg-vrv2-v86f
  • security: Only compile partials that are template strings - c28ee7a
  • security: Only dispatch known node types in the Compiler and Visitor - 7d501a5
  • security: Validate AST values in the compiler instead of the parser - 703fdcc GHSA-8r5x-fm3f-whwj
  • Clarify that --root does not restrict filesystem access - 0fcf25c
  • Bump minimist to ^1.2.8 - ea8ed82
  • Fix Ruby component publishing documentation - d069c1c
  • Fix Composer component definition - 6714e07

Compatibility notes:

  • {{#each}} iterates iterables such as Map, Set and generators lazily, like for...of, instead of copying them into an array first. Values added to the iterable while the block renders are now visited too.

Commits

Changelog

Sourced from handlebars's changelog.

v4.7.10 - October 5th, 2026

  • security: Sanitize the source map URL when minifying - f37c599
  • security: Iterate lazily in #each and strip whitespace in linear time - 812c226
  • security: Escape <!-- and <script in precompiled output - 609d1b1 GHSA-xw65-4hp5-5hc7
  • security: Don't trust special properties on context data - ceec388 GHSA-p8wg-vrv2-v86f
  • security: Only compile partials that are template strings - c28ee7a
  • security: Only dispatch known node types in the Compiler and Visitor - 7d501a5
  • security: Validate AST values in the compiler instead of the parser - 703fdcc GHSA-8r5x-fm3f-whwj
  • Clarify that --root does not restrict filesystem access - 0fcf25c
  • Bump minimist to ^1.2.8 - ea8ed82
  • Fix Ruby component publishing documentation - d069c1c
  • Fix Composer component definition - 6714e07

Compatibility notes:

  • {{#each}} iterates iterables such as Map, Set and generators lazily, like for...of, instead of copying them into an array first. Values added to the iterable while the block renders are now visited too.

Commits

Commits
  • 45ce152 v4.7.10
  • e47b236 Update release notes
  • f37c599 Sanitize the source map URL when minifying
  • 812c226 Iterate lazily in #each and strip whitespace in linear time
  • 609d1b1 Escape <!-- and <script in precompiled output
  • ceec388 Don't trust special properties on context data
  • c28ee7a Only compile partials that are template strings
  • 7d501a5 Only dispatch known node types in the Compiler and Visitor
  • 703fdcc Validate AST values in the compiler instead of the parser
  • 0fcf25c Clarify that --root does not restrict filesystem access
  • Additional commits viewable in compare view

Updates sanitize-html from 2.17.7 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.

2.18.1 (2026-10-14)

Changes

  • Remove the deepmerge dependency, which was used only to combine tag-specific and * (all tags) entries in allowedClasses and allowedStyles. That is now done by a few lines of code within sanitize-html.

    This is not a fix for a vulnerability in sanitize-html. Security scanners such as Snyk now report CVE-2026-93753 in deepmerge, which can affect applications that merge untrusted objects, such as parsed JSON request bodies. sanitize-html only ever merged the developer's own configuration, never anything taken from the HTML being sanitized, so it was not exploitable through sanitize-html. Since we needed only a small part of what deepmerge does, we removed the dependency so that these reports no longer appear for sanitize-html users.

Security

  • Since 2.18.0, the fallback markup of a discarded <iframe> was re-sanitized by a recursive call with no limit, one level per nested unclosed <iframe>. A few kilobytes of crafted input could throw RangeError: Maximum call stack size exceeded with the default options, and the nestingLimit option was not enforced across the fallback because each nested call started counting from zero. The fallback of a discarded <iframe> is still sanitized and kept, but only up to eight nested <iframe> elements (deeper fallback is escaped as text, as before 2.18.0), and the current nesting depth now carries into the nested call so nestingLimit applies to the whole output. Only 2.18.0 was affected, and the exception is thrown synchronously, so applications that catch errors from sanitizeHtml only lost the affected request (CWE-674, GHSA-c9rx-x947-fp3h).

    Thanks to hkmj19, JohnBeckley, and amikhailovstiltsoft for reporting the vulnerability.

2.18.0 (2026-09-30)

Adds

  • Added a logger option: pass any console-shaped object, with debug, info, warn and error methods, and sanitize-html's own diagnostics are delivered to it rather than to the console, so an application with a logging pipeline of its own can route them. Missing methods, and no option at all, fall back to the console. Those messages also lost their decorative line breaks and warning icon, so each is now a single line of text; their wording is otherwise unchanged.

Fixes

  • allowedSchemesByTag is now applied to srcset and imagesrcset URLs. Previously the per-tag lookup used the attribute name instead of the tag name, so these attributes always fell back to the global allowedSchemes and ignored a tag-specific scheme allowlist. Thanks to spokodev for the fix.
  • Starting in version 2.17.6, sanitize-html began escaping any markup preserved inside a disallowed iframe tag, which was a change in behavior due to an upstream change in htmlparser2. This fix ensures such "fallback markup" is preserved without escaping, but also fully sanitized according to the same rules as the original input. Thanks to sumitjhacodes for the fix.

Security

... (truncated)

Commits

Updates handlebars from 4.7.9 to 4.7.10

Release notes

Sourced from handlebars's releases.

v4.7.10

  • security: Sanitize the source map URL when minifying - f37c599
  • security: Iterate lazily in #each and strip whitespace in linear time - 812c226
  • security: Escape <!-- and <script in precompiled output - 609d1b1 GHSA-xw65-4hp5-5hc7
  • security: Don't trust special properties on context data - ceec388 GHSA-p8wg-vrv2-v86f
  • security: Only compile partials that are template strings - c28ee7a
  • security: Only dispatch known node types in the Compiler and Visitor - 7d501a5
  • security: Validate AST values in the compiler instead of the parser - 703fdcc GHSA-8r5x-fm3f-whwj
  • Clarify that --root does not restrict filesystem access - 0fcf25c
  • Bump minimist to ^1.2.8 - ea8ed82
  • Fix Ruby component publishing documentation - d069c1c
  • Fix Composer component definition - 6714e07

Compatibility notes:

  • {{#each}} iterates iterables such as Map, Set and generators lazily, like for...of, instead of copying them into an array first. Values added to the iterable while the block renders are now visited too.

Commits

Changelog

Sourced from handlebars's changelog.

v4.7.10 - October 5th, 2026

  • security: Sanitize the source map URL when minifying - f37c599
  • security: Iterate lazily in #each and strip whitespace in linear time - 812c226
  • security: Escape <!-- and <script in precompiled output - 609d1b1 GHSA-xw65-4hp5-5hc7
  • security: Don't trust special properties on context data - ceec388 GHSA-p8wg-vrv2-v86f
  • security: Only compile partials that are template strings - c28ee7a
  • security: Only dispatch known node types in the Compiler and Visitor - 7d501a5
  • security: Validate AST values in the compiler instead of the parser - 703fdcc GHSA-8r5x-fm3f-whwj
  • Clarify that --root does not restrict filesystem access - 0fcf25c
  • Bump minimist to ^1.2.8 - ea8ed82
  • Fix Ruby component publishing documentation - d069c1c
  • Fix Composer component definition - 6714e07

Compatibility notes:

  • {{#each}} iterates iterables such as Map, Set and generators lazily, like for...of, instead of copying them into an array first. Values added to the iterable while the block renders are now visited too.

Commits

Commits
  • 45ce152 v4.7.10
  • e47b236 Update release notes
  • f37c599 Sanitize the source map URL when minifying
  • 812c226 Iterate lazily in #each and strip whitespace in linear time
  • 609d1b1 Escape <!-- and <script in precompiled output
  • ceec388 Don't trust special properties on context data
  • c28ee7a Only compile partials that are template strings
  • 7d501a5 Only dispatch known node types in the Compiler and Visitor
  • 703fdcc Validate AST values in the compiler instead of the parser
  • 0fcf25c Clarify that --root does not restrict filesystem access
  • Additional commits viewable in compare view

Updates sanitize-html from 2.17.7 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.

2.18.1 (2026-10-14)

Changes

  • Remove the deepmerge dependency, which was used only to combine tag-specific and * (all tags) entries in allowedClasses and allowedStyles. That is now done by a few lines of code within sanitize-html.

    This is not a fix for a vulnerability in sanitize-html. Security scanners such as Snyk now report CVE-2026-93753 in deepmerge, which can affect applications that merge untrusted objects, such as parsed JSON request bodies. sanitize-html only ever merged the developer's own configuration, never anything taken from the HTML being sanitized, so it was not exploitable through sanitize-html. Since we needed only a small part of what deepmerge does, we removed the dependency so that these reports no longer appear for sanitize-html users.

Security

  • Since 2.18.0, the fallback markup of a discarded <iframe> was re-sanitized by a recursive call with no limit, one level per nested unclosed <iframe>. A few kilobytes of crafted input could throw RangeError: Maximum call stack size exceeded with the default options, and the nestingLimit option was not enforced across the fallback because each nested call started counting from zero. The fallback of a discarded <iframe> is still sanitized and kept, but only up to eight nested <iframe> elements (deeper fallback is escaped as text, as before 2.18.0), and the current nesting depth now carries into the nested call so nestingLimit applies to the whole output. Only 2.18.0 was affected, and the exception is thrown synchronously, so applications that catch errors from sanitizeHtml only lost the affected request (CWE-674, GHSA-c9rx-x947-fp3h).

    Thanks to hkmj19, JohnBeckley, and amikhailovstiltsoft for reporting the vulnerability.

2.18.0 (2026-09-30)

Adds

  • Added a logger option: pass any console-shaped object, with debug, info, warn and error methods, and sanitize-html's own diagnostics are delivered to it rather than to the console, so an application with a logging pipeline of its own can route them. Missing methods, and no option at all, fall back to the console. Those messages also lost their decorative line breaks and warning icon, so each is now a single line of text; their wording is otherwise unchanged.

Fixes

  • allowedSchemesByTag is now applied to srcset and imagesrcset URLs. Previously the per-tag lookup used the attribute name instead of the tag name, so these attributes always fell back to the global allowedSchemes and ignored a tag-specific scheme allowlist. Thanks to spokodev for the fix.
  • Starting in version 2.17.6, sanitize-html began escaping any markup preserved inside a disallowed iframe tag, which was a change in behavior due to an upstream change in htmlparser2. This fix ensures such "fallback markup" is preserved without escaping, but also fully sanitized according to the same rules as the original input. Thanks to sumitjhacodes for the fix.

Security

... (truncated)

Commits

Updates sanitize-html from 2.17.7 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.

2.18.1 (2026-10-14)

Changes

  • Remove the deepmerge dependency, which was used only to combine tag-specific and * (all tags) entries in allowedClasses and allowedStyles. That is now done by a few lines of code within sanitize-html.

    This is not a fix for a vulnerability in sanitize-html. Security scanners such as Snyk now report CVE-2026-93753 in deepmerge, which can affect applications that merge untrusted objects, such as parsed JSON request bodies. sanitize-html only ever merged the developer's own configuration, never anything taken from the HTML being sanitized, so it was not exploitable through sanitize-html. Since we needed only a small part of what deepmerge does, we removed the dependency so that these reports no longer appear for sanitize-html users.

Security

  • Since 2.18.0, the fallback markup of a discarded <iframe> was re-sanitized by a recursive call with no limit, one level per nested unclosed <iframe>. A few kilobytes of crafted input could throw RangeError: Maximum call stack size exceeded with the default options, and the nestingLimit option was not enforced across the fallback because each nested call started counting from zero. The fallback of a discarded <iframe> is still sanitized and kept, but only up to eight nested <iframe> elements (deeper fallback is escaped as text, as before 2.18.0), and the current nesting depth now carries into the nested call so nestingLimit applies to the whole output. Only 2.18.0 was affected, and the exception is thrown synchronously, so applications that catch errors from sanitizeHtml only lost the affected request (CWE-674, GHSA-c9rx-x947-fp3h).

    Thanks to hkmj19, JohnBeckley, and amikhailovstiltsoft for reporting the vulnerability.

2.18.0 (2026-09-30)

Adds

  • Added a logger option: pass any console-shaped object, with debug, info, warn and error methods, and sanitize-html's own diagnostics are delivered to it rather than to the console, so an application with a logging pipeline of its own can route them. Missing methods, and no option at all, fall back to the console. Those messages also lost their decorative line breaks and warning icon, so each is now a single line of text; their wording is otherwise unchanged.

Fixes

  • allowedSchemesByTag is now applied to srcset and imagesrcset URLs. Previously the per-tag lookup used the attribute name instead of the tag name, so these attributes always fell back to the global allowedSchemes and ignored a tag-specific scheme allowlist. Thanks to spokodev for the fix.
  • Starting in version 2.17.6, sanitize-html began escaping any markup preserved inside a disallowed iframe tag, which was a change in behavior due to an upstream change in htmlparser2. This fix ensures such "fallback markup" is preserved without escaping, but also fully sanitized according to the same rules as the original input. Thanks to sumitjhacodes for the fix.

Security

... (truncated)

Commits

Updates sanitize-html from 2.17.7 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.

2.18.1 (2026-10-14)

Changes

  • Remove the deepmerge dependency, which was used only to combine tag-specific and * (all tags) entries in allowedClasses and allowedStyles. That is now done by a few lines of code within sanitize-html.

    This is not a fix for a vulnerability in sanitize-html. Security scanners such as Snyk now report CVE-2026-93753 in deepmerge, which can affect applications that merge untrusted objects, such as parsed JSON request bodies. sanitize-html only ever merged the developer's own configuration, never anything taken from the HTML being sanitized, so it was not exploitable through sanitize-html. Since we needed only a small part of what deepmerge does, we removed the dependency so that these reports no longer appear for sanitize-html users.

Security

  • Since 2.18.0, the fallback markup of a discarded <iframe> was re-sanitized by a recursive call with no limit, one level per nested unclosed <iframe>. A few kilobytes of crafted input could throw RangeError: Maximum call stack size exceeded with the default options, and the nestingLimit option was not enforced across the fallback because each nested call started counting from zero. The fallback of a discarded <iframe> is still sanitized and kept, but only up to eight nested <iframe> elements (deeper fallback is escaped as text, as before 2.18.0), and the current nesting depth now carries into the nested call so nestingLimit applies to the whole output. Only 2.18.0 was affected, and the exception is thrown synchronously, so applications that catch errors from sanitizeHtml only lost the affected request (CWE-674, GHSA-c9rx-x947-fp3h).

    Thanks to hkmj19, JohnBeckley, and amikhailovstiltsoft for reporting the vulnerability.

2.18.0 (2026-09-30)

Adds

  • Added a logger option: pass any console-shaped object, with debug, info, warn and error methods, and sanitize-html's own diagnostics are delivered to it rather than to the console, so an application with a logging pipeline of its own can route them. Missing methods, and no option at all, fall back to the console. Those messages also lost their decorative line breaks and warning icon, so each is now a single line of text; their wording is otherwise unchanged.

Fixes

  • allowedSchemesByTag is now applied to srcset and imagesrcset URLs. Previously the per-tag lookup used the attribute name instead of the tag name, so these attributes always fell back to the global allowedSchemes and ignored a tag-specific scheme allowlist. Thanks to spokodev for the fix.
  • Starting in version 2.17.6, sanitize-html began escaping any markup preserved inside a disallowed iframe tag, which was a change in behavior due to an upstream change in htmlparser2. This fix ensures such "fallback markup" is preserved without escaping, but also fully sanitized according to the same rules as the original input. Thanks to sumitjhacodes for the fix.

Security

... (truncated)

Commits

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 <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  • @dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  • @dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  • @dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
  • @dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions
    You can disable automated security fix PRs for this repo from the Security Alerts page.

…updates

Bumps the npm-security group with 2 updates in the / directory: [handlebars](https://github.com/handlebars-lang/handlebars.js) and [sanitize-html](https://github.com/apostrophecms/apostrophe/tree/HEAD/packages/sanitize-html).
Bumps the npm-security group with 1 update in the /docs directory: [sanitize-html](https://github.com/apostrophecms/apostrophe/tree/HEAD/packages/sanitize-html).


Updates `handlebars` from 4.7.9 to 4.7.10
- [Release notes](https://github.com/handlebars-lang/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/v4.7.10/release-notes.md)
- [Commits](handlebars-lang/handlebars.js@v4.7.9...v4.7.10)

Updates `sanitize-html` from 2.17.7 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)

Updates `handlebars` from 4.7.9 to 4.7.10
- [Release notes](https://github.com/handlebars-lang/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/v4.7.10/release-notes.md)
- [Commits](handlebars-lang/handlebars.js@v4.7.9...v4.7.10)

Updates `sanitize-html` from 2.17.7 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)

Updates `sanitize-html` from 2.17.7 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)

Updates `sanitize-html` from 2.17.7 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: handlebars
  dependency-version: 4.7.10
  dependency-type: direct:production
  dependency-group: npm-security
- dependency-name: sanitize-html
  dependency-version: 2.18.2
  dependency-type: indirect
  dependency-group: npm-security
- dependency-name: handlebars
  dependency-version: 4.7.10
  dependency-type: direct:production
  dependency-group: npm-security
- dependency-name: sanitize-html
  dependency-version: 2.18.2
  dependency-type: indirect
  dependency-group: npm-security
- dependency-name: sanitize-html
  dependency-version: 2.18.2
  dependency-type: indirect
  dependency-group: npm-security
- dependency-name: sanitize-html
  dependency-version: 2.18.2
  dependency-type: indirect
  dependency-group: npm-security
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants