Track vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
3.4
CVE-2026-126359: Hono css helper allows HTML injection
CVE-2026-126359 · published 20 days ago
Summary
The Hono web framework's css helper does not properly block a closing tag when a '<' appears just before a variable and the variable starts with '/'. This lets a malicious user inject raw HTML or script into pages that are rendered on the server. Upgrade to a patched version of Hono or avoid inserting unchecked values into css templates.
What to do
- Update hono to version 4.13.16.
- Update GitHub Actions hono to version 4.13.16.
Affected software
| Ecosystem | Vendor | Product | Affected versions |
|---|---|---|---|
| npm | – | hono |
>= 3.12.0, <= 4.13.15 Fix: upgrade to 4.13.16
|
| npm | GitHub Actions | hono |
>= 3.12.0, <= 4.13.15 Fix: upgrade to 4.13.16
|
Original advisory text
Hono: `css` helper does not escape a closing tag split between the template and an interpolated value, allowing HTML injection
### 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 `<`.
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 `<`.
References
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/126xxx/CVE-2026-1263... Vendor Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2026-126359 Vendor Advisory
- https://github.com/honojs/hono/security/advisories/GHSA-3gg2-335m-rxc6
- https://github.com/honojs/hono/commit/15bbd96ad1b62a0b189db4fd8dc7bf8ef280c513
- https://github.com/honojs/hono/releases/tag/v4.13.16
- https://github.com/advisories/GHSA-3gg2-335m-rxc6
Internet-facing
60 days
Internal
At next upgrade
- Not known to be exploited
- Needs hands-on effort to exploit
- Gives an attacker partial control
Type
CWE-79Cross-site Scripting (XSS)
Timeline
Published12 Nov 2026
Updated2 Dec 2026
First seen12 Nov 2026
Track software like this
Free during beta