# CVE-2026-59895: Hono XSS in hono/css cx() utility

Source: https://junglewise.ai/threats/cve-2026-59895-hono-xss-in-hono-css-cx-utility  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-08. Updated: 2026-07-21  
License: CC BY 4.0 with a link back

CVE-2026-59895 · Severity: medium · CVSS 6.1 · Published 2026-07-08

A vulnerability in the Hono web framework could allow attackers to inject malicious scripts into web pages. Hono is a popular tool used by developers to build fast web applications. If an application uses a specific styling utility with data provided by a user, an attacker could take over user sessions or steal sensitive information like login credentials.

Technologies: [hono (npm)](https://junglewise.ai/threats/technologies/hono). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-59895 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-59895 being exploited in the wild.

**How severe is CVE-2026-59895?** Medium severity, with a CVSS score of 6.1, published 8 July 2026.

**Which products and versions are affected?** hono (npm) >= 4.0.0, < 4.12.27, SEMVER:introduced=4.0.0,fixed=4.12.27.

**Is there a fix for CVE-2026-59895?** Yes. hono (npm): upgrade to 4.12.27 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-59895 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-59895?** Check whether you run hono (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- hono (npm): upgrade to 4.12.27 or later

  ```sh
  npm install hono@4.12.27
  ```


## Technical details

A Cross-Site Scripting (XSS) vulnerability exists in Hono's `cx()` utility within the `hono/css` package. The `cx()` function composes CSS class names but incorrectly marks the resulting string as 'already escaped' without actually performing HTML entity encoding on the input. When this result is used in a JSX `class` attribute during server-side rendering (SSR), an attacker can provide input containing quotes to break out of the attribute and inject arbitrary HTML or JavaScript. This requires the application to pass untrusted, user-controlled strings to `cx()`. The issue is resolved in version 4.12.27.

## Affected products

- honojs hono >= 4.0.0, < 4.12.27

## Identifiers

- CVE-2026-59895
- GHSA-w62v-xxxg-mg59

## Timeline

- 2026-06-23: patched: Fixed in version 4.12.27
- 2026-07-21: advisory: GitHub Advisory published

## References

- [https://api.github.com/users/a-tt-om](https://api.github.com/users/a-tt-om)
- [https://github.com/a-tt-om](https://github.com/a-tt-om)
- [https://api.github.com/users/a-tt-om/gists%7B/gist_id%7D](https://api.github.com/users/a-tt-om/gists%7B/gist_id%7D)
- [https://api.github.com/users/a-tt-om/repos](https://api.github.com/users/a-tt-om/repos)
- [https://avatars.githubusercontent.com/u/92680067?v=4](https://avatars.githubusercontent.com/u/92680067?v=4)
- [https://api.github.com/users/a-tt-om/events%7B/privacy%7D](https://api.github.com/users/a-tt-om/events%7B/privacy%7D)

## Related threats

- [Hono: `css` helper does not escape a closing tag split between the template and an interpolated value, allowing HTML injection](https://junglewise.ai/threats/cve-2026-126359-hono-css-helper-does-not-escape-a-closing-tag-split-between-the)
- [Hono RegExpRouter middleware bypass via wildcard matching](https://junglewise.ai/threats/cve-2026-126358-hono-regexprouter-skips-wildcard-middleware-for-some-route-sets)
- [Hono mount() path traversal bypasses middleware scoping](https://junglewise.ai/threats/cve-2026-126357-hono-mount-and-app-mount-can-forward-a-path-that-bypasses)
- [Hono validator form multipart/form-data parameter bypass](https://junglewise.ai/threats/cve-2026-126356-hono-validator-form-skips-validation-for-multipart-form-data)
- [Hono csrf() middleware bypass via hyperlink auditing](https://junglewise.ai/threats/cve-2026-126355-hono-csrf-does-not-check-requests-sent-by-hyperlink-auditing)
