Impact
The vulnerability arises from an incomplete patch of a prior JWT algorithm confusion flaw. In fast‑jwt versions 6.1.0 and earlier, the public key matching regular expression incorrectly accepts a key string that begins with whitespace, causing the regex to fail at the start anchor. This re‑enables the ability to manipulate the algorithm field of a JWT and trick the library into verifying a forged token. The flaw is categorized as CWE‑327, representing the misuse of cryptographic algorithms. If exploited, an attacker could generate valid‑looking tokens that grant unauthorized access to protected resources, undermining confidentiality and integrity of the service.
Affected Systems
The affected product is the nearform fast‑jwt library. Versions 6.1.0 and any earlier releases contain the flaw; newer releases are not affected. This applies to all applications that depend on fast‑jwt for JWT verification, especially those using RSA public key verification.
Risk and Exploitability
With a CVSS score of 9.1, the vulnerability is considered critical. While an EPSS score is not available, the high severity rating indicates a significant risk if the flaw is present. The attack likely occurs remotely by supplying a crafted JWT with a whitespace‑prefixed RSA public key to services that use fast‑jwt, allowing token forgery. The vulnerability does not appear in the CISA Known Exploited Vulnerabilities catalog, but the lack of a patch in older versions makes it a high‑risk issue for systems still running 6.1.0 or earlier.
OpenCVE Enrichment
Github GHSA