Description
fast-jwt provides fast JSON Web Token (JWT) implementation. In 6.2.4, fast-jwt can classify raw serialized public JWK or JWKS JSON as an HMAC secret because src/crypto.js performDetectPublicKeyAlgorithms treats non-PEM strings as symmetric key material. If HS256 is explicitly allowed or inferred, an attacker who knows the exact serialized public-key bytes can use those bytes as an HMAC key and create a token containing arbitrary claims that createVerifier accepts. Serialization ordering or whitespace differences can prevent exploitation, and applications using supported PEM keys with an asymmetric-only algorithm allowlist are not affected. This issue is fixed in version 6.3.0.
Published: 2026-10-08
Score: 7.4 High
EPSS: < 1% Very Low
KEV: No
Impact: Token forgery enabling unauthorized claims
Action: Patch immediately
AI Analysis

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.

Generated by OpenCVE AI on October 8, 2026 at 23:44 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade fast-jwt to version 6.3.0 or later
  • Disable HS256 or enforce an algorithm allowlist that permits only asymmetric algorithms such as RS256 or ES256
  • Verify that the validation logic checks the algorithm header and does not treat public key JSON as an HMAC secret

Generated by OpenCVE AI on October 8, 2026 at 23:44 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-g3jj-5cmm-3hxx fast-jwt treats raw public JWK JSON as an HMAC secret, enabling HS256 token forgery
History

Fri, 09 Oct 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Fri, 09 Oct 2026 00:15:00 +0000

Type Values Removed Values Added
First Time appeared Nearform
Nearform fast-jwt
Vendors & Products Nearform
Nearform fast-jwt

Thu, 08 Oct 2026 22:00:00 +0000

Type Values Removed Values Added
Description fast-jwt provides fast JSON Web Token (JWT) implementation. In 6.2.4, fast-jwt can classify raw serialized public JWK or JWKS JSON as an HMAC secret because src/crypto.js performDetectPublicKeyAlgorithms treats non-PEM strings as symmetric key material. If HS256 is explicitly allowed or inferred, an attacker who knows the exact serialized public-key bytes can use those bytes as an HMAC key and create a token containing arbitrary claims that createVerifier accepts. Serialization ordering or whitespace differences can prevent exploitation, and applications using supported PEM keys with an asymmetric-only algorithm allowlist are not affected. This issue is fixed in version 6.3.0.
Title fast-jwt treats raw public JWK JSON as an HMAC secret, enabling HS256 token forgery
Weaknesses CWE-347
References
Metrics cvssV3_1

{'score': 7.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N'}


Subscriptions

Nearform Fast-jwt
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-09T15:51:27.488Z

Reserved: 2026-10-08T17:21:52.976Z

Link: CVE-2026-107724

cve-icon Vulnrichment

Updated: 2026-10-09T15:50:59.802Z

cve-icon NVD

Status : Deferred

Published: 2026-10-08T22:17:28.800

Modified: 2026-10-09T16:17:23.740

Link: CVE-2026-107724

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-09T00:00:09Z

Weaknesses
  • CWE-347

    Improper Verification of Cryptographic Signature