CVE-2026-22817: Hono Hono JWT Middleware's JWT Algorithm Vulnerability
HIGHCVE-2026-22817 is a HIGH (CVSS 8.2) hono jwt middleware's jwt algorithm vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Hono libraries in the npm ecosystem. The issue involves hono jwt middleware's jwt algorithm confusion via unsafe default (hs256) allows token forgery and auth bypass. Remediation is available by upgrading affected packages to version 4.11.4.
CVE-2026-22817 at a Glance
Security Impact
CVSS: 8.2
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:N/S:U/C:L/I:H/A:N).
How to Fix CVE-2026-22817
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.11.4
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-22817, 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.11.4), 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-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. 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-22817 Affected Hono Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
hono
|
npm |
< 4.11.4
|
4.11.4
|
References
Frequently Asked Questions
What is CVE-2026-22817?
Which Hono versions are affected?
What version fixes CVE-2026-22817?
Is hono affected?
What is the CVSS score of CVE-2026-22817?
What CWE is associated with CVE-2026-22817?
How can I check npm dependencies for CVE-2026-22817?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f67f-6cw9-8mq4",
"modified" : "2026-01-13T21:51:45Z",
"published" : "2026-01-13T21:51:44Z",
"aliases" : [ "CVE-2026-22817" ],
"summary" : "Hono JWT Middleware's JWT Algorithm Confusion via Unsafe Default (HS256) Allows Token Forgery and Auth Bypass",
"details" : "## Summary\n\nA flaw in Hono’s JWK/JWKS JWT verification middleware allowed the JWT header’s `alg` value to influence signature verification when the selected JWK did not explicitly specify an algorithm. This could enable **JWT algorithm confusion** and, in certain configurations, allow forged tokens to be accepted.\n\n## Details\n\nWhen verifying JWTs using JWKs or a JWKS endpoint, the middleware selected the verification algorithm based on the JWK’s `alg` field if present, but otherwise fell back to the `alg` value provided in the unverified JWT header.\n\nBecause the `alg` field in a JWK is optional and often omitted in real-world JWKS configurations, this behavior could allow an attacker to control the algorithm used for verification. In some environments, this may lead to authentication or authorization\nbypass through crafted tokens.\n\nThe practical impact depends on application configuration, including which algorithms are accepted and how JWTs are used for authorization decisions.\n\n## Impact\n\nIn affected configurations, an attacker may be able to forge JWTs with attacker-controlled claims, potentially resulting in authentication or authorization bypass.\n\nApplications that do not use the JWK/JWKS middleware, do not rely on JWT-based authentication, or explicitly restrict allowed algorithms are not affected.\n\n## Resolution\n\nUpdate to the latest patched release.\n\n**Breaking change:**\n\nAs part of this fix, the JWT middleware now requires the `alg` option to be explicitly specified. This prevents algorithm confusion by ensuring that the verification algorithm is not derived from untrusted JWT header values.\n\nApplications upgrading must update their configuration accordingly.\n\n### Before (vulnerable configuration)\n\n```ts\nimport { jwt } from 'hono/jwt'\n\napp.use(\n '/auth/*',\n jwt({\n secret: 'it-is-very-secret',\n // alg was optional\n })\n)\n```\n\n### After (patched configuration)\n\n```ts\nimport { jwt } from 'hono/jwt'\n\napp.use(\n '/auth/*',\n jwt({\n secret: 'it-is-very-secret',\n alg: 'HS256', // required\n })\n)\n```",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "hono"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.11.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/honojs/hono/security/advisories/GHSA-f67f-6cw9-8mq4"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22817"
}, {
"type" : "WEB",
"url" : "https://github.com/honojs/hono/commit/cc0aa7ae327ed84cc391d29086dec2a3e44e7a1f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/honojs/hono"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-347" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-01-13T21:51:44Z",
"nvd_published_at" : "2026-01-13T20:16:11Z"
}
}