Vulnerability · Published May 24, 2022 · Assigned by GitHub_M

CVE-2022-29217Key confusion through non-blocklisted public key formats in PyJWT

High 7.4

In plain English

A high-severity broken cryptography in pyjwt from jpadilla. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.4% (higher than 72% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.4High
Exploit odds (30 days)1.4%top 28.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

PyJWT is a Python implementation of RFC 7519. PyJWT supports multiple different JWT signing algorithms. With JWT, an attacker submitting the JWT token can choose the used signing algorithm. The PyJWT library requires that the application chooses what algorithms are supported. The application can specify `jwt.algorithms.get_default_algorithms()` to get support for all algorithms, or specify a single algorithm. The issue is not that big as `algorithms=jwt.algorithms.get_default_algorithms()` has to be used. Users should upgrade to v2.4.0 to receive a patch for this issue. As a workaround, always be explicit with the algorithms that are accepted and expected when decoding.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.20py3-jwt2.4.0-r0ALPINE-CVE-2022-29217
Alpine:v3.21py3-jwt2.4.0-r0ALPINE-CVE-2022-29217
Alpine:v3.22py3-jwt2.4.0-r0ALPINE-CVE-2022-29217
Alpine:v3.23py3-jwt2.4.0-r0ALPINE-CVE-2022-29217
Alpine:v3.24py3-jwt2.4.0-r0ALPINE-CVE-2022-29217
Debian:12pyjwt2.4.0-1DEBIAN-CVE-2022-29217
Debian:13pyjwt2.4.0-1DEBIAN-CVE-2022-29217
Debian:14pyjwt2.4.0-1DEBIAN-CVE-2022-29217
PyPIpyjwt2.4.0PYSEC-2022-202
PyPIpyjwt2.4.0GHSA-ffqj-6fqr-9h24
Ubuntu:22.04:LTSpyjwt2.3.0-1ubuntu0.1UBUNTU-CVE-2022-29217
Ubuntu:22.04:LTSpyjwt2.3.0-1ubuntu0.1USN-5526-1

Affected products (as reported)

VendorProductVersions
jpadilla pyjwt >= 1.5.0, < 2.4.0

Weakness: CWE-327 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

References