Miggo Logo

GHSA-m732-5p4w-x69g: Hono Improper Authorization vulnerability

8.1

CVSS Score
3.1

Basic Information

CVE ID
-
EPSS Score
-
Published
10/22/2025
Updated
10/22/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
hononpm>= 1.1.0, < 4.10.24.10.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in Hono's JWT middleware, which failed to validate the 'aud' (Audience) claim in JWTs by default. This violates RFC 7519 and creates a confused-deputy vulnerability. An attacker could use a valid token issued for a different service to gain unauthorized access to a Hono application if both services share the same token issuer.

The analysis of the patch commit 45ba3bf9e3dff8e4bd85d6b47d4b71c8d6c66bef reveals that the core of the vulnerability was in the verify function located in src/utils/jwt/jwt.ts. This function is central to JWT validation in Hono. Before the patch, it checked claims like exp and iat but completely ignored the aud claim. The patch rectifies this by adding explicit logic to validate the token's aud claim against the audience specified in the verification options.

The vulnerability also affected the verifyWithJwks function, as it is a wrapper around the verify function. Although verifyWithJwks was not directly modified, the fix in verify ensures that any call to verifyWithJwks will now correctly perform audience validation. Therefore, both verify and verifyWithJwks are identified as the key functions that would appear in a runtime profile during the exploitation of this vulnerability.

Vulnerable functions

verify
src/utils/jwt/jwt.ts
The `verify` function is responsible for JWT validation. Prior to the patch, it did not validate the `aud` (audience) claim of the token. This omission allowed a valid token intended for a different service or audience to be accepted, leading to an improper authorization vulnerability. The patch introduces logic to check the `aud` claim against the expected audience provided in the verification options.
verifyWithJwks
src/utils/jwt/jwt.ts
The `verifyWithJwks` function retrieves a key from a JWKS and then uses the `verify` function to perform the actual token validation. Because it relied on the vulnerable `verify` function which lacked the audience check, `verifyWithJwks` was also susceptible to the same token mix-up vulnerability. The fix applied to `verify` transitively secures `verifyWithJwks`.

WAF Protection Rules

WAF Rule

### Improp*r *ut*oriz*tion in *ono (JWT *u*i*n** V*li**tion) *ono’s JWT *ut**nti**tion mi**l*w*r* *i* not v*li**t* t** `*u*` (*u*i*n**) *l*im *y ****ult. *s * r*sult, *ppli**tions usin* t** mi**l*w*r* wit*out *n *xpli*it *u*i*n** ****k *oul* ****pt

Reasoning

T** vuln*r**ility li*s in *ono's JWT mi**l*w*r*, w*i** **il** to v*li**t* t** '*u*' (*u*i*n**) *l*im in JWTs *y ****ult. T*is viol*t*s R** **** *n* *r**t*s * *on*us**-**puty vuln*r**ility. *n *tt**k*r *oul* us* * v*li* tok*n issu** *or * *i***r*nt s*