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.
- Exploited in the wild
- Not known
- Login needed
- An administrator
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
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
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 | 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 |
Linux distribution packages (1)
python-PyJWT openSUSE:Tumbleweed | All versions | 2.10.1-1.1 |
Products include 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 PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard
- CVE-2026-32597 PyJWT accepts unknown `crit` header extensions (RFC 7515 §4.1.11 MUST violation)
- CVE-2026-102266 PyJWK accepts empty HMAC keys, bypassing PyJWT's empty-key validation
- CVE-2026-102267 PyJWT: PyJWKClient follows redirects when fetching JWKS
- CVE-2026-102271 PyJWT: Public keys in DER form are accepted as HMAC secrets, bypassing the CVE-2022-29217 guard
Sources
Also known as GHSA-75c5-xw7c-p5pm, PYSEC-2026-1814, openSUSE-SU-2024:14540-1.