Description
PyJWT is a JSON Web Token implementation in Python. Prior to 2.13.0, when the verifier is decoding JSON Web Tokens, while supporting both asymmetric and HMAC algorithms, the library does not validate use of JSON Web Keys in HMAC algorithm, allowing attacker to use the issuer public key as the secret key for HMAC algorithm. This vulnerability is fixed in 2.13.0.
Published: 2026-05-28
Score: 7.4 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

PyJWT, a widely used JSON Web Token library for Python, allows an attacker to produce forged HS256 tokens by providing a public key in JSON Web Key (JWK) format and treating it as an HMAC secret. Because the library does not validate the use of JWKs when the algorithm is set to a symmetric HMAC family, an attacker can compute a valid HMAC signature using the public key bytes and bypass authentication checks that rely solely on the token's signature. This vulnerability enables the attacker to impersonate any user or system that accepts the token, potentially elevating privileges or accessing sensitive resources.

Affected Systems

The issue affects all installations of the jpadilla:pyjwt package whose version is older than 2.13.0. Many Python applications, including web services, API gateways, and authentication frameworks, rely on this library for token validation, so any project embedding PyJWT v2.12.x or earlier is susceptible.

Risk and Exploitability

With a CVSS score of 7.4, the vulnerability represents a high‑severity risk. Although the EPSS score is not available and the vulnerability is not listed in the CISA KEV catalog, the attack vector is likely remote: an adversary can supply a forged token to any endpoint that accepts JWTs. If the application accepts the token without additional checks, the attacker can gain unauthorized access, compromising confidentiality and integrity of protected resources. The lack of a public exploit suggests that this vulnerability has not yet been widely leveraged, but the difficulty of proof of concept is low since the library is a common dependency.

Generated by OpenCVE AI on May 28, 2026 at 16:38 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade PyJWT to version 2.13.0 or newer.
  • Reconfigure the application to disallow the use of JSON Web Keys for HMAC algorithms, ensuring that each token’s algorithm and key type match the expected family.
  • Validate that the token’s algorithm matches the key type used for verification, rejecting any mismatched or mixed family tokens before accepting them.

Generated by OpenCVE AI on May 28, 2026 at 16:38 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 28 May 2026 17:00:00 +0000

Type Values Removed Values Added
First Time appeared Jpadilla
Jpadilla pyjwt
Vendors & Products Jpadilla
Jpadilla pyjwt

Thu, 28 May 2026 15:30:00 +0000

Type Values Removed Values Added
Description PyJWT is a JSON Web Token implementation in Python. Prior to 2.13.0, when the verifier is decoding JSON Web Tokens, while supporting both asymmetric and HMAC algorithms, the library does not validate use of JSON Web Keys in HMAC algorithm, allowing attacker to use the issuer public key as the secret key for HMAC algorithm. This vulnerability is fixed in 2.13.0.
Title PyJWT: Public-key JWK accepted as HMAC secret enables forged HS256 tokens when mixed families are allowed
Weaknesses CWE-287
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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-05-28T15:09:09.258Z

Reserved: 2026-05-21T16:18:10.619Z

Link: CVE-2026-48526

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-05-28T16:16:29.657

Modified: 2026-05-28T16:16:29.657

Link: CVE-2026-48526

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-28T16:45:20Z

Weaknesses