GHSA-3gg2-335m-rxc6: Hono: `css` helper does not escape a closing tag split between the template and an interpolated value, allowing HTML injection

Published Nov 12, 2026
·
Updated

Summary

The css helper in hono/css escapes a / that follows < inside an interpolated value so that a value cannot close the <style> element. The check only looks inside each value. When the text before a value ends with <, whether that is the template itself or an earlier interpolated value, and the next value starts with /, the / is not escaped and the combined output contains an unescaped closing tag.

Details

Interpolated string values are escaped one at a time before they are joined with the surrounding template text. The rule that neutralizes </ therefore cannot see a < that belongs to the template. A template such as a content declaration that opens with a literal < and interpolates a string right after it produces a raw </style> when that string starts with /style>. During server-side rendering the <Style /> element is closed early and the rest of the value is interpreted as HTML.

This issue arises only when < is the last character before an interpolation in a css template, either written in the template or supplied by a preceding value, and the interpolated value is controlled by a client.

Impact

A client that controls such a value can inject HTML, including script, into the page rendered on the server.

This may lead to:

- Execution of attacker-controlled script in the browser of a user who views the page - Exposure of information available to that page

This issue affects applications that interpolate untrusted strings into a css template immediately after a <, including two adjacent interpolations such as ${prefix}${name} where both are untrusted. Other uses of the css helper are not affected.

Workarounds

Do not interpolate untrusted values into css templates, or make sure the text before an interpolated value does not end with <.

Other sources

Hono is a Web application framework that provides support for any JavaScript runtime. From 3.12.0 until 4.13.16, the css helper in hono/css escapes interpolated string values separately and therefore fails to neutralize a closing style tag when &lt; ends the template text or a preceding value and / begins the next attacker-controlled value. During server-side rendering, the combined output can close the &lt;Style /&gt; element early and cause the remainder of the interpolated value to be interpreted as HTML. Applications that place an untrusted string immediately after &lt; in a css template, including adjacent untrusted interpolations, can expose viewers to attacker-controlled HTML or script and information accessible to that page. Other uses of the css helper are not affected. This issue is fixed in version 4.13.16.

— OSV

Affected Software

2 affected componentsFixes available
npm/hono>=3.12.0<=4.13.15
4.13.16
npm/hono>=3.12.0<4.13.16
4.13.16

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/hono to a version that resolves this vulnerability.

    Fixed in 4.13.16
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 4.13.16
  3. Compensating control

    Do not interpolate untrusted values into `css` templates; alternatively, ensure the text immediately before each interpolated value does not end with `<`.

Event History

Nov 12, 2026
CVE Published
via OSV·10:22 PM
Data Sourced
via OSV·10:22 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·11:22 PM
Data Sourced
via GitHub·11:22 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·11:22 PM
Affected Software

Frequently Asked Questions

1

Which applications are exposed in practice?

Only applications that use the hono/css css template helper with a literal or prior interpolated value ending in '<' immediately before another interpolation are affected. The following interpolated value must be controlled by a client and begin with '/'.

2

How can I identify vulnerable template patterns?

Review css template interpolations for boundaries where the character immediately before an interpolation is '<', including where that character comes from an earlier interpolated value. Prioritize cases where the next value can contain client-supplied input.

3

What does an attacker need to supply?

The attacker needs control of an interpolated string positioned after a trailing '<' and must make that value start with '/style>'. This produces a raw closing style tag during server-side rendering, allowing the remaining value to be interpreted as HTML.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203