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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | py3-jwt | 2.4.0-r0 | ALPINE-CVE-2022-29217 |
| Alpine:v3.21 | py3-jwt | 2.4.0-r0 | ALPINE-CVE-2022-29217 |
| Alpine:v3.22 | py3-jwt | 2.4.0-r0 | ALPINE-CVE-2022-29217 |
| Alpine:v3.23 | py3-jwt | 2.4.0-r0 | ALPINE-CVE-2022-29217 |
| Alpine:v3.24 | py3-jwt | 2.4.0-r0 | ALPINE-CVE-2022-29217 |
| Debian:12 | pyjwt | 2.4.0-1 | DEBIAN-CVE-2022-29217 |
| Debian:13 | pyjwt | 2.4.0-1 | DEBIAN-CVE-2022-29217 |
| Debian:14 | pyjwt | 2.4.0-1 | DEBIAN-CVE-2022-29217 |
| PyPI | pyjwt | 2.4.0 | PYSEC-2022-202 |
| PyPI | pyjwt | 2.4.0 | GHSA-ffqj-6fqr-9h24 |
| Ubuntu:22.04:LTS | pyjwt | 2.3.0-1ubuntu0.1 | UBUNTU-CVE-2022-29217 |
| Ubuntu:22.04:LTS | pyjwt | 2.3.0-1ubuntu0.1 | USN-5526-1 |
Affected products (as reported)
Weakness: CWE-327 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
References
- https://github.com/jpadilla/pyjwt/security/advisories/GHSA-ffqj-6fqr-9h24 x_refsource_CONFIRM
- https://github.com/jpadilla/pyjwt/commit/9c528670c455b8d948aff95ed50e22940d1ad3fc x_refsource_MISC
- https://github.com/jpadilla/pyjwt/releases/tag/2.4.0 x_refsource_MISC
- FEDORA-2022-3cf456dc20 vendor-advisory, x_refsource_FEDORA
- FEDORA-2022-4ae9110f51 vendor-advisory, x_refsource_FEDORA
- https://www.vicarius.io/vsociety/posts/risky-algorithms-algorithm-confusion-in-pyjwt-cve-2022-29217