Feb 20, 2026·7 min read·92 visits
Hono's JWT middleware implicitly trusted the algorithm specified in the incoming token header. Attackers can force the server to verify a token using 'HS256' with the server's own public key as the secret, effectively bypassing authentication. Fixed in version 4.11.4.
A critical authentication bypass in the Hono web framework allows attackers to forge JSON Web Tokens (JWTs) by confusing the verification middleware. By swapping the cryptographic algorithm from asymmetric (RS256) to symmetric (HS256) and signing the token with the victim's public key, an attacker can gain administrative access without a valid private key.
In the world of web security, some vulnerabilities are like zombies—they just refuse to stay dead. Enter CVE-2026-22817, a classic 'Algorithm Confusion' attack targeting the Hono web framework. If you thought we left this class of bugs back in 2015 along with non-responsive layouts and Flash players, I have bad news for you.
Hono has been gaining massive traction in the JavaScript/TypeScript ecosystem for its speed and standards-based approach. It runs everywhere—Cloudflare Workers, Bun, Node.js, Deno. It is the darling of the edge computing world. But in version 4.11.3 and earlier, its JWT (JSON Web Token) middleware harbored a flaw that is almost nostalgic in its simplicity.
The vulnerability allows an attacker to look at your application, which is securely configured to use high-end asymmetric cryptography (RSA), and politely ask it to downgrade to a simple symmetric check using a key the attacker already possesses. It’s the cryptographic equivalent of a bank vault that opens if you just scribble 'I am the manager' on a sticky note and paste it to the door.
To understand this exploit, you have to understand how JWT libraries decide how to verify a signature. A JWT header contains an alg field, which tells the recipient which mathematical operation was used to sign the token. Common values are RS256 (Asymmetric) and HS256 (Symmetric).
In an RS256 setup, the server holds a Private Key (secret) to sign tokens and distributes a Public Key (open to the world) so anyone can verify them. In an HS256 setup, the server uses a single shared secret to both sign and verify.
The flaw in Hono's middleware was a lack of conviction. If the developer didn't strictly enforce a specific algorithm in their configuration, the middleware looked at the incoming token's header to decide what to do. This is a fatal mistake.
When an attacker changes the header to alg: HS256, the middleware switches logic. Instead of treating the configured key as an RSA Public Key (for verification only), it treats the binary data of that Public Key as a shared HMAC secret. Since the Public Key is public, the attacker has it. They can then sign their own forged admin token using HMAC-SHA256 with the Public Key as the password. The server, seeing HS256 in the header and holding the Public Key, performs the same math, gets a match, and grants access.
Let's look at the logic that caused this mess. The vulnerability existed because the middleware prioritized flexibility over security, allowing the incoming packet to dictate the terms of engagement.
In the vulnerable versions, the code logic (simplified) looked something like this:
// Vulnerable Logic Pseudocode
const algorithmToUse = config.alg || tokenHeader.alg;
if (algorithmToUse === 'HS256') {
verifyHmac(token, key);
} else if (algorithmToUse === 'RS256') {
verifyRsa(token, key);
}Do you see the issue? If config.alg wasn't explicitly set by the developer (which was optional), the variable algorithmToUse fell back to tokenHeader.alg—a value controlled entirely by the attacker.
The fix in v4.11.4 introduces a strict mismatch check. It basically says, "I don't care what the token claims to be; if it doesn't match what I expect, throw it in the trash."
// The Fix in Hono v4.11.4
if (header.alg !== alg) {
throw new JwtAlgorithmMismatch(alg, header.alg);
}
// Specific hardening for JWK (JSON Web Keys)
if (symmetricAlgorithms.includes(header.alg)) {
throw new JwtSymmetricAlgorithmNotAllowed(header.alg);
}This simple check kills the attack dead. Even if the attacker sends a validly signed HS256 token, the server checks its config, sees it expects RS256, and throws a JwtAlgorithmMismatch error before even attempting the crypto math.
Let's walk through a practical attack scenario. Imagine a target application running on Cloudflare Workers using Hono. It uses Auth0 or a similar provider, so it exposes a .well-known/jwks.json endpoint containing its RSA public keys.
The attacker browses to https://target-app.com/.well-known/jwks.json and downloads the RSA Public Key. It looks like a standard JSON object containing a modulus (n) and exponent (e).
The attacker captures a valid JWT from the application. It looks like this:
eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiYWRtaW4iOmZhbHNlfQ.Signature...
The attacker decodes the token and changes the payload to give themselves superpowers:
{
"sub": "hacker",
"admin": true
}Crucially, they change the header to lie about the algorithm:
{
"alg": "HS256",
"typ": "JWT"
}Here is the magic trick. The attacker takes the RSA Public Key they downloaded in Step 1. They convert it to a string format (usually PEM) and use that string as the secret key for an HMAC-SHA256 signature.
// Attacker's script
const forgedToken = jwt.sign(
{ sub: 'hacker', admin: true },
publicKeyPEM, // Using the PUBLIC key as a SECRET
{ algorithm: 'HS256' }
);The attacker sends this forged token to the Hono app. The app receives the header HS256. It looks at its config, sees the Public Key. It thinks, "Okay, I'll verify this HMAC using the key I have." The math aligns perfectly. The attacker is logged in as Admin.
The CVSS score of 8.2 implies high severity, but the practical impact is often total system compromise. Because JWTs are typically used for stateless authentication, bypassing the signature check allows an attacker to become anyone.
/admin/delete_user).This isn't just a "theoretical" crypto bug. It works reliably against any system where the developer relied on defaults and didn't hardcode the expected algorithm. In the fast-moving world of JS frameworks, developers often copy-paste middleware configs without second-guessing the optional parameters.
If you are running Hono, stop reading and run npm update hono. The fix was released in version 4.11.4 on January 13, 2026.
Beyond just updating, this is a lesson in explicit configuration. Never rely on the "magic" of a library to guess your cryptographic intent. Explicit is better than implicit.
Remediation Steps:
// BAD: Vulnerable to confusion if defaults are loose
app.use('/api/*', jwt({ secret: publicKey }))
// GOOD: Explicitly locks the algorithm
app.use('/api/*', jwt({ secret: publicKey, alg: 'RS256' }))If you are using JWKs (JSON Web Key Sets), the new version forces you to provide an allowedAlgorithms whitelist or strictly rejects symmetric algorithms when fetching keys from a remote source. This prevents the library from ever attempting an HMAC verification when it should be doing RSA.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
hono honojs | < 4.11.4 | 4.11.4 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-347 |
| Attack Vector | Network (Remote) |
| CVSS Score | 8.2 (Critical) |
| Exploit Status | PoC Available |
| Impact | Authentication Bypass |
| EPSS Score | 0.017% |
Improper Verification of Cryptographic Signature
A high-severity logic inversion flaw in the uniget CLI completely bypasses Sigstore cryptographic signature verification on metadata files by default. If an attacker can poison the package metadata cache or repository, they can execute arbitrary OS commands under the privileges of the active user.
A technical analysis of CVE-2026-59903 in Netty's HTTP CORS handler, where the CorsHandler overwrites existing application Vary headers with Origin, leading to unauthorized caching of sensitive information.
An uncontrolled resource consumption vulnerability in Netty's SctpMessageCompletionHandler allows unauthenticated remote attackers to cause a Denial of Service. By transmitting a series of large, fragmented Stream Control Transmission Protocol (SCTP) messages, an attacker can exhaust the Java Virtual Machine heap or direct memory. This occurs because the handler fails to enforce limits on the cumulative byte size of buffered, incomplete SCTP fragments.
A command injection bypass vulnerability exists in the Glances system monitoring tool prior to v4.5.6. This flaw permits an attacker with local process or container metadata control to bypass action-template sanitizers by reconstructing shell execution operators across adjacent unescaped variables. When a system alert triggers a configured action template, the reconstructed operators are evaluated by the underlying shell, leading to arbitrary code execution in the context of the Glances process.
Grav CMS prior to version 1.7.53 and 2.0.0-rc.8 is vulnerable to an unauthenticated remote denial of service (DoS) vulnerability. By supplying crafted query parameters with extremely large dimensions to image assets, remote unauthenticated attackers can force the server to allocate massive amounts of system memory, leading to kernel Out-Of-Memory (OOM) termination of web worker processes.
CVE-2026-53657 is a local privilege escalation vulnerability in Lima (lima-vm/lima) affecting versions prior to 2.1.3 when configured with the QEMU driver. The guest agent daemon, running as root, creates its communication socket `/run/lima-guestagent.sock` with world-writable permissions (0777). This allows unprivileged local users to command the agent to establish arbitrary tunnels, including to privileged local UNIX sockets (like D-Bus). Because the target daemon authenticates the incoming connection using the credentials of the root-owned guest agent (via SO_PEERCRED), unprivileged users can perform root operations, resulting in complete guest VM compromise.