CVE-2026-59895: Hono Cross-Site Scripting Vulnerability
MODERATECVE-2026-59895 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Hono libraries in the npm ecosystem. The issue involves server-side xss via jsx escaping bypass in cx() utility. Remediation is available by upgrading affected packages to version 4.12.27.
CVE-2026-59895 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2026-59895
To remediate this vulnerability, upgrade all affected Hono dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install hono@4.12.27
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls hono
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-59895, inspect your project dependencies using npm:
npm ls hono
Analyze the terminal output to locate any version of Hono in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.12.27), your application is affected.
Note: The npm ls hono command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Hono, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-59895 Affected Hono Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
hono
|
npm |
≥ 4.0.0
< 4.12.27
|
4.12.27
|
References
Frequently Asked Questions
What is CVE-2026-59895?
Which Hono versions are affected?
What version fixes CVE-2026-59895?
Is hono affected?
What is the CVSS score of CVE-2026-59895?
What CWE is associated with CVE-2026-59895?
How can I check npm dependencies for CVE-2026-59895?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w62v-xxxg-mg59",
"modified" : "2026-07-21T18:33:50Z",
"published" : "2026-07-21T18:33:50Z",
"aliases" : [ "CVE-2026-59895" ],
"summary" : "Hono: Server-Side XSS via JSX Escaping Bypass in cx() Utility",
"details" : "### Summary\n\n`cx()` in `hono/css` composes class names from plain strings but marks the result as already-escaped without HTML-escaping the input. When the result is used as a JSX `class` attribute during server-side rendering, the value is written into the attribute unescaped, so untrusted input can break out of the `class` attribute and inject arbitrary markup, leading to Cross-Site Scripting (XSS).\n\n### Details\n\nBecause the composed value is treated as pre-escaped, the HTML attribute escaping normally applied to interpolated values is skipped, and characters such as `\"` pass through unescaped — allowing a value to terminate the attribute and add further attributes or elements. This arises when an application passes untrusted, user-controlled input as a class name to `cx()`, for example when merging a base class with an externally provided `className`.\n\n### Impact\n\nDuring server-side rendering, an attacker who controls a value passed to `cx()` can inject arbitrary HTML into the page, resulting in stored or reflected XSS in the victim's browser.\n\nThis may lead to:\n\n- Execution of attacker-controlled script in the victim's browser session.\n- Session hijacking, credential theft, or actions performed on behalf of the victim.\n\nApplications are affected only if they render JSX server-side and pass untrusted input as a class name to `cx()`.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "hono"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "4.12.27"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/honojs/hono/security/advisories/GHSA-w62v-xxxg-mg59"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-59895"
}, {
"type" : "WEB",
"url" : "https://github.com/honojs/hono/commit/cd3f6f7194f0e5c9d4b26ae0cf232018d0f388fc"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/honojs/hono"
}, {
"type" : "WEB",
"url" : "https://github.com/honojs/hono/releases/tag/v4.12.27"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-116", "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-21T18:33:50Z",
"nvd_published_at" : "2026-07-08T17:17:27Z"
}
}