Impact
This vulnerability allows an attacker to explain that the JWT library can incorrectly treat an RSA public key as an HMAC secret when the key text contains hidden non‑whitespace characters before the PEM header. The result is that the library falls back to HS256, an HMAC algorithm, for which the attacker can compute a signature using the public key bytes. The effect is that an attacker who knows the public key can forge arbitrary HS256 tokens and gain unauthorized authentication or authorization.
Affected Systems
The issue affects the package nearform:fast-jwt versions from 6.2.0 up through the last release before 6.3.0. The safe fix is to update to version 6.3.0 or later, which removes the fallback and enforces strict PEM detection.
Risk and Exploitability
The CVSS base score of 9.8 indicates critical severity. EPSS data is not available, so the exploitation probability is unknown, but the root cause is a severe algorithm confusion that is publicly known. The vulnerability is not listed in the CISA KEV catalog. Attackers would need to supply or obtain the public key and use the library’s signing function; an allowlist that permits only asymmetric algorithms eliminates the attack surface.
OpenCVE Enrichment
Github GHSA