Improper Verification of Cryptographic Signature Affecting pyjwt package, versions [,2.14.0)


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.2% (9th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-PYJWT-20249112
  • published29 Sept 2026
  • disclosed28 Sept 2026
  • credite1

Introduced: 28 Sep 2026

NewCVE-2026-102268  (opens in a new tab)
CWE-347  (opens in a new tab)

How to fix?

Upgrade PyJWT to version 2.14.0 or higher.

Overview

PyJWT is a Python implementation of RFC 7519.

Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature via is_pem_format() in jwt/utils.py, which fails to recognize certain loader-accepted PEM formatting variants as valid PEM. The fix for CVE-2022-29217 rejects an asymmetric key passed to an HMAC algorithm only when is_pem_format() identifies the key as PEM-encoded. Because the old regex does not match all PEM variants that the underlying cryptography library's loader accepts, an attacker can supply a non-standard but loader-accepted PEM key to bypass the asymmetric-key-as-HMAC-secret guard, enabling signature forgery.

Note: This is only exploitable when the application accepts a user-influenced key or algorithm selection that allows an asymmetric public key to be used as an HMAC secret.

CVSS Base Scores

version 4.0
version 3.1