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

Low 2.2 Published Updated

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.

PackageAffectedFixed in
pyjwt PyPIFrom 2.10.02.10.1
pyjwt PyPIFrom 2.10.02.10.1
PyJWT PyPIFrom 2.10.02.10.1
Linux distribution packages (1)
python-PyJWT openSUSE:TumbleweedAll versions2.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.

Sources

Also known as GHSA-75c5-xw7c-p5pm, PYSEC-2026-1814, openSUSE-SU-2024:14540-1.

Is CVE-2024-53861 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free