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

> Attackers can bypass JWT signature verification by exploiting algorithm confusion when applications explicitly enable all default algorithms.

- **Severity:** High 7.4 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 May 2022
- **Updated:** 23 Apr 2025
- **Also known as:** AZL-9852, CLSA-2025-1756858338, DEBIAN-CVE-2022-29217, GHSA-ffqj-6fqr-9h24, MGASA-2022-0244, OESA-2022-1710, PYSEC-2022-202, SUSE-SU-2022:2401-1, SUSE-SU-2022:2402-1, SUSE-SU-2022:2403-1, SUSE-SU-2022:3545-1, SUSE-SU-2023:0794-1, UBUNTU-CVE-2022-29217, USN-5526-1, USN-5526-2, openSUSE-SU-2024:12139-1, openSUSE-SU-2025:14987-1

## What is CVE-2022-29217?

CVE-2022-29217 is a high-severity vulnerability in Fedoraproject Fedora, published on 24 May 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### 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.

Weakness: CWE-327 (Use of a Broken or Risky Cryptographic Algorithm)

## Which versions are affected by CVE-2022-29217?

3 open source packages ship an affected version, including pyjwt. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pyjwt` | PyPI | From 1.5.0 | 2.4.0 |
| `pyjwt` | PyPI | From 1.5.0 | 2.4.0 |
| `pyjwt` | PyPI | From 1.5.0 | 2.4.0 |
| `python-PyJWT` | SUSE:Enterprise Storage 6 | All versions | 1.7.1-150100.6.7.1 |
| `python-PyJWT` | SUSE:Enterprise Storage 7 | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Enterprise Storage 7 | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Enterprise Storage 7.1 | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 1.7.1-150100.6.7.1 |
| `python-PyJWT` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 1.7.1-150100.6.7.1 |
| `python-PyJWT` | SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Linux Enterprise Module for Package Hub 15 SP3 | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Module for Public Cloud 12 | All versions | 1.5.3-3.16.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Module for Public Cloud 15 | All versions | 1.5.3-150000.3.3.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Module for Public Cloud 15 SP1 | All versions | 1.7.1-150100.6.7.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Module for Public Cloud 15 SP2 | All versions | 1.7.1-150100.6.7.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Real Time 15 SP3 | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 1.7.1-150100.6.7.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 1.7.1-150100.6.7.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Server 15 SP2-BCL | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 1.7.1-150100.6.7.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Manager Proxy 4.1 | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Manager Proxy 4.2 | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | SUSE:Manager Retail Branch Server 4.1 | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Manager Server 4.1 | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | SUSE:Manager Server 4.2 | All versions | 2.4.0-150200.3.6.2 |
| `python-PyJWT` | openSUSE:Leap 15.3 | All versions | 1.7.1-150200.3.3.1 |
| `python-PyJWT` | openSUSE:Leap 15.4 | All versions | 1.7.1-150200.3.3.1 |

Products: Fedoraproject Fedora, Pyjwt Project Pyjwt.

## How do I fix CVE-2022-29217?

Upgrade pyjwt to 2.4.0 or later.

## Is CVE-2022-29217 being exploited?

There is no known exploitation of CVE-2022-29217 in the wild and no public exploit code.

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-4577](https://insights.sbomify.com/CVE-2024-4577/): PHP-CGI OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2021-39226](https://insights.sbomify.com/CVE-2021-39226/): Grafana Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2019-5544](https://insights.sbomify.com/CVE-2019-5544/): VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2024-4947](https://insights.sbomify.com/CVE-2024-4947/): Google Chromium V8 Type Confusion (critical 9.6, exploited in the wild)
- [CVE-2024-4671](https://insights.sbomify.com/CVE-2024-4671/): Google Chromium Visuals Use-After-Free (critical 9.6, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-29217 and fix it if it is affected.

What it is: CVE-2022-29217 is a high-severity vulnerability in Fedoraproject Fedora, published on 24 May 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-29217 in the wild and no public exploit code.

Affected packages and fixed versions:
- pyjwt (PyPI): affected from 1.5.0; fixed in 2.4.0
- pyjwt (PyPI): affected from 1.5.0; fixed in 2.4.0
- pyjwt (PyPI): affected from 1.5.0; fixed in 2.4.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-29217/ (Markdown: https://insights.sbomify.com/CVE-2022-29217/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-29217
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-29217
- OSV: https://osv.dev/vulnerability/CVE-2022-29217

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-29217/
Summaries are generated and may contain mistakes; the official description above is the record.
