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: < 1% Very Low
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
Source ID Title
Github GHSA Github GHSA GHSA-xgmm-8j9v-c9wx PyJWT: Public-key JWK accepted as HMAC secret enables forged HS256 tokens when mixed families are allowed
References
Link Providers
https://access.redhat.com/errata/RHSA-2026:25902 cve-icon
https://access.redhat.com/errata/RHSA-2026:25928 cve-icon
https://access.redhat.com/errata/RHSA-2026:26206 cve-icon
https://access.redhat.com/errata/RHSA-2026:28571 cve-icon
https://access.redhat.com/errata/RHSA-2026:30076 cve-icon
https://access.redhat.com/errata/RHSA-2026:30088 cve-icon
https://access.redhat.com/errata/RHSA-2026:30089 cve-icon
https://access.redhat.com/errata/RHSA-2026:33683 cve-icon
https://access.redhat.com/errata/RHSA-2026:34160 cve-icon
https://access.redhat.com/errata/RHSA-2026:34365 cve-icon
https://access.redhat.com/errata/RHSA-2026:34374 cve-icon
https://access.redhat.com/errata/RHSA-2026:35835 cve-icon
https://access.redhat.com/errata/RHSA-2026:35836 cve-icon
https://access.redhat.com/errata/RHSA-2026:35837 cve-icon
https://access.redhat.com/errata/RHSA-2026:35845 cve-icon
https://access.redhat.com/errata/RHSA-2026:36350 cve-icon
https://access.redhat.com/errata/RHSA-2026:37275 cve-icon
https://access.redhat.com/errata/RHSA-2026:40967 cve-icon
https://access.redhat.com/errata/RHSA-2026:41066 cve-icon
https://access.redhat.com/errata/RHSA-2026:42132 cve-icon
https://access.redhat.com/errata/RHSA-2026:42142 cve-icon
https://access.redhat.com/errata/RHSA-2026:42144 cve-icon
https://access.redhat.com/errata/RHSA-2026:42644 cve-icon
https://access.redhat.com/errata/RHSA-2026:42796 cve-icon
https://access.redhat.com/errata/RHSA-2026:43038 cve-icon
https://access.redhat.com/errata/RHSA-2026:48085 cve-icon
https://access.redhat.com/errata/RHSA-2026:50222 cve-icon
https://access.redhat.com/errata/RHSA-2026:50223 cve-icon
https://access.redhat.com/errata/RHSA-2026:50263 cve-icon
https://access.redhat.com/errata/RHSA-2026:50319 cve-icon
https://access.redhat.com/errata/RHSA-2026:50336 cve-icon
https://access.redhat.com/errata/RHSA-2026:50340 cve-icon
https://access.redhat.com/errata/RHSA-2026:50904 cve-icon
https://access.redhat.com/security/cve/CVE-2026-48526 cve-icon
https://bugzilla.redhat.com/show_bug.cgi?id=2482734 cve-icon
https://github.com/jpadilla/pyjwt/security/advisories/GHSA-xgmm-8j9v-c9wx cve-icon cve-icon cve-icon
https://nvd.nist.gov/vuln/detail/CVE-2026-48526 cve-icon
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-48526.json cve-icon
https://www.cve.org/CVERecord?id=CVE-2026-48526 cve-icon
History

Fri, 05 Jun 2026 12:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Important


Mon, 01 Jun 2026 18:00:00 +0000

Type Values Removed Values Added
First Time appeared Pyjwt Project
Pyjwt Project pyjwt
CPEs cpe:2.3:a:pyjwt_project:pyjwt:*:*:*:*:*:*:*:*
Vendors & Products Pyjwt Project
Pyjwt Project pyjwt

Fri, 29 May 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


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'}


Subscriptions

Jpadilla Pyjwt
Pyjwt Project Pyjwt
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-17T12:05:04.453Z

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

Link: CVE-2026-48526

cve-icon Vulnrichment

Updated: 2026-08-17T12:05:04.453Z

cve-icon NVD

Status : Modified

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

Modified: 2026-08-17T12:18:48.490

Link: CVE-2026-48526

cve-icon Redhat

Severity : Important

Publid Date: 2026-05-28T15:09:09Z

Links: CVE-2026-48526 - Bugzilla

cve-icon OpenCVE Enrichment

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

Weaknesses
  • CWE-287

    Improper Authentication

  • CWE-347

    Improper Verification of Cryptographic Signature