Impact
fast-jwt incorrectly treats raw serialized public JWK or JWKS JSON as an HMAC secret when the algorithm is not PEM‑encoded. When HS256 is accepted, an attacker who knows the exact serialized public key bytes can use those bytes as an HMAC key and create a signed JWT containing arbitrary claims. This flaw allows an attacker to forge tokens that the library accepts, leading to potential privilege escalation, impersonation, or unauthorized access within any system that trusts the token.
Affected Systems
The vulnerability affects the nearform fast-jwt library. Versions 6.2.4 and earlier are impacted; the issue was fixed in release 6.3.0.
Risk and Exploitability
The CVSS score of 7.4 reflects moderate severity. No EPSS score is available, and the issue is not listed in CISA KEV. The attack requires knowledge of the public key serialization, but many libraries do not sufficiently normalize ordering or whitespace, so the key bytes can be determined or observed. The likely attack vector is a remote request to an application that accepts HS256 tokens signed with the vulnerable library, allowing token forgery over HTTP or API endpoints.
OpenCVE Enrichment
Github GHSA