# CVE-2024-53861: Issuer field partial matches allowed in pyjwt

> Attackers can bypass issuer validation in pyjwt due to incorrect string comparison, potentially causing denial of service or accepting invalid tokens.

- **Severity:** Low 2.2 (`CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Nov 2024
- **Updated:** 2 Dec 2024
- **Also known as:** GHSA-75c5-xw7c-p5pm, PYSEC-2026-1814, openSUSE-SU-2024:14540-1

## What is CVE-2024-53861?

CVE-2024-53861 is a low-severity vulnerability in jpadilla pyjwt, published on 29 Nov 2024. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

pyjwt is a JSON Web Token implementation in Python. An incorrect string comparison is run for `iss` checking, resulting in `"acb"` being accepted for `"_abc_"`. This is a bug introduced in version 2.10.0: checking the "iss" claim changed from `isinstance(issuer, list)` to `isinstance(issuer, Sequence)`. Since str is a Sequnce, but not a list, `in` is also used for string comparison. This results in `if "abc" not in "__abcd__":` being checked instead of `if "abc" != "__abc__":`. Signature checks are still present so real world impact is likely limited to denial of service scenarios. This issue has been patched in version 2.10.1. All users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-697 (Incorrect Comparison)

## Which versions are affected by CVE-2024-53861?

3 open source packages ship an affected version, including pyjwt and PyJWT. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pyjwt` | PyPI | From 2.10.0 | 2.10.1 |
| `pyjwt` | PyPI | From 2.10.0 | 2.10.1 |
| `PyJWT` | PyPI | From 2.10.0 | 2.10.1 |
| `python-PyJWT` | openSUSE:Tumbleweed | All versions | 2.10.1-1.1 |

Products: Pyjwt Project Pyjwt.

## How do I fix CVE-2024-53861?

Upgrade pyjwt to 2.10.1 or later.

## Is CVE-2024-53861 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-53861 exists.

## Other vulnerabilities in jpadilla pyjwt

- [CVE-2026-102268](https://insights.sbomify.com/CVE-2026-102268/): PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard (critical 9.1)
- [CVE-2026-32597](https://insights.sbomify.com/CVE-2026-32597/): PyJWT accepts unknown `crit` header extensions (RFC 7515 §4.1.11 MUST violation) (high 7.5)
- [CVE-2026-102266](https://insights.sbomify.com/CVE-2026-102266/): PyJWK accepts empty HMAC keys, bypassing PyJWT's empty-key validation (high 7.4)
- [CVE-2026-102267](https://insights.sbomify.com/CVE-2026-102267/): PyJWT: PyJWKClient follows redirects when fetching JWKS (high 7.4)
- [CVE-2026-102271](https://insights.sbomify.com/CVE-2026-102271/): PyJWT: Public keys in DER form are accepted as HMAC secrets, bypassing the CVE-2022-29217 guard (high 7.4)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-53861 and fix it if it is affected.

What it is: CVE-2024-53861 is a low-severity vulnerability in jpadilla pyjwt, published on 29 Nov 2024. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-53861 exists.

Affected packages and fixed versions:
- pyjwt (PyPI): affected from 2.10.0; fixed in 2.10.1
- pyjwt (PyPI): affected from 2.10.0; fixed in 2.10.1
- PyJWT (PyPI): affected from 2.10.0; fixed in 2.10.1

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-2024-53861/ (Markdown: https://insights.sbomify.com/CVE-2024-53861/index.md)
```

## Sources

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

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