SB20260917213 - Multiple vulnerabilities in pyjwt



SB20260917213 - Multiple vulnerabilities in pyjwt

Published: September 17, 2026

Security Bulletin ID SB20260917213
CSH Severity
High
Patch available
YES
Number of vulnerabilities 8
Exploitation vector Remote access
Highest impact Data manipulation

Breakdown by Severity

High 13% Medium 88%
  • Low
  • Medium
  • High
  • Critical

Description

This security bulletin contains information about 8 vulnerabilities.


1) Incorrect Behavior Order: Validate Before Canonicalize (CVE-ID: N/A)

CWE-ID: CWE-180 - Incorrect Behavior Order: Validate Before Canonicalize

CVSSv4: 6.3 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to bypass token revocation controls.

The vulnerability exists due to incorrect behavior order: validate before canonicalize in compact JWS signature-segment decoding when processing a compact JWS with a non-canonical signature segment. A remote attacker can append non-Base64URL characters to a valid token\'s signature segment to bypass token revocation controls.

Exploitation requires an application to use the raw serialized token as the identity for revocation, replay, rate-limit, or cache state.


2) Uncontrolled Recursion (CVE-ID: N/A)

CWE-ID: CWE-674 - Uncontrolled Recursion

CVSSv4: 6.9 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to cause a denial of service.

The vulnerability exists due to uncontrolled recursion in the PyJWS._load() header JSON parsing path when processing a compact token with a deeply nested JSON header. A remote attacker can send an unsigned crafted token to cause a denial of service.

The header is parsed before signature verification, and the resulting exception can bypass applications\' normal PyJWT error handling.


3) Improper Verification of Cryptographic Signature (CVE-ID: N/A)

CWE-ID: CWE-347 - Improper Verification of Cryptographic Signature

CVSSv4: 9.1 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to bypass authentication.

The vulnerability exists due to improper verification of cryptographic signatures in PyJWK HMAC key verification when verifying HS256 tokens using an empty oct JWK. A remote attacker can generate a forged HS256 JWT signed with the zero-length HMAC key to bypass authentication.

The application must already load an empty symmetric oct JWK, and minimum HMAC key-length enforcement must be disabled.


4) Improper Verification of Cryptographic Signature (CVE-ID: N/A)

CWE-ID: CWE-347 - Improper Verification of Cryptographic Signature

CVSSv4: 9.1 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to forge authentication tokens with arbitrary claims.

The vulnerability exists due to improper verification of cryptographic signatures in HMACAlgorithm.prepare_key when verifying tokens with DER-form asymmetric public keys while HMAC and asymmetric algorithms are enabled. A remote attacker can submit a forged HMAC-signed token to forge authentication tokens with arbitrary claims.

The issue does not affect PyJWK or PyJWKClient verification paths.


5) Improper Verification of Cryptographic Signature (CVE-ID: N/A)

CWE-ID: CWE-347 - Improper Verification of Cryptographic Signature

CVSSv4: 9.3 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to forge arbitrary-claim tokens.

The vulnerability exists due to improper verification of cryptographic signatures in HMACAlgorithm.prepare_key and is_pem_format when processing a loader-accepted PEM public key that is not recognized as PEM under a mixed algorithm allow-list. A remote attacker can sign an HS256 token using the public key as an HMAC secret to forge arbitrary-claim tokens.

Exploitation requires knowledge of the public verification key, cryptography to be installed, and use of the raw PEM non-PyJWK verification path.


6) Server-Side Request Forgery (SSRF) (CVE-ID: N/A)

CWE-ID: CWE-918 - Server-Side Request Forgery (SSRF)

CVSSv4: 9.1 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to disclose sensitive request headers and cause forged JWT acceptance.

The vulnerability exists due to improper validation of redirect destinations in PyJWKClient when fetching JWKS from an attacker-influenced configured endpoint. A remote attacker can cause the endpoint to return a redirect to a different host to disclose sensitive request headers and cause forged JWT acceptance.

A token kid alone does not trigger the issue.


7) Improper Verification of Cryptographic Signature (CVE-ID: N/A)

CWE-ID: CWE-347 - Improper Verification of Cryptographic Signature

CVSSv4: 9.1 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to forge JWT claims.

The vulnerability exists due to improper verification of cryptographic signatures in PyJWT\'s HMAC key handling when verifying tokens with a public JWK container supplied as an HMAC key. A remote attacker can use known public key material to create forged HS256, HS384, or HS512 tokens to forge JWT claims.

Exploitation requires an application to allow both symmetric and asymmetric algorithms in the same verification path and use raw public JWK or JWKS JSON as the HMAC key.


8) Improper Verification of Cryptographic Signature (CVE-ID: N/A)

CWE-ID: CWE-347 - Improper Verification of Cryptographic Signature

CVSSv4: 9.1 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to forge authentication tokens with arbitrary claims.

The vulnerability exists due to improper verification of cryptographic signatures in HMACAlgorithm.from_jwk when resolving JWKs for HMAC signature verification. A remote attacker can submit a forged bearer token signed with an empty HMAC key to forge authentication tokens with arbitrary claims.

The issue is reachable when a trusted JWKS contains an oct entry whose k value is empty.


Remediation

Install update from vendor's website.