Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2024-53861 — pyjwt

🟢 CVSS 2.0 — Low ⚠️ Exploit Public CWE-697 OSV
2.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

PyJWT Issuer field partial matches allowed

Summary

The wrong string if check is run for iss checking, resulting in "acb" being accepted for "_abc_".

Details

This is a bug introduced in version [2.10.0](https://github.com/jpadilla/pyjwt/commit/1570e708672aa9036bc772476beae8bfa48f4131#diff-6893ad4a1c5a36b8af3028db8c8bc3b62418149843fc382faf901eaab008e380R366): checking the "iss" claim

changed from isinstance(issuer, list) to `isinstance(issuer,

Sequence)`.

```diff

  • if isinstance(issuer, list):

+ if isinstance(issuer, Sequence):

if payload["iss"] not in issuer:

raise InvalidIssuerError("Invalid issuer")

else:

```

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__":.

PoC

Check out the unit tests added here: https://github.com/jpadilla/pyjwt-ghsa-75c5-xw7c-p5pm

```python

issuer = "urn:expected"

payload = {"iss": "urn:"}

token = jwt.encode(payload, "secret")

# decode() succeeds, even though `"urn:" != "urn:expected". No exception is raised.

with pytest.raises(InvalidIssuerError):

jwt.decode(token, "secret", issuer=issuer, algorithms=["HS256"])

```

Impact

I would say the real world impact is not that high, seeing as the signature still has to match. We should still fix it.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs administrative privileges on the target. No user interaction is required. Rated impact: confidentiality none, integrity low, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Attack requirements: Present — the target has to be in a particular state for the attack to work.
  • Privileges required: High — administrative rights are needed first.
  • User interaction: None — nobody has to be tricked into anything.
  • Confidentiality impact: None.
  • Integrity impact: Low — limited, and the attacker does not choose what is affected.
  • Availability impact: None.

Weakness class

CVE-2024-53861 is classified as CWE-697: Incorrect Comparison. The product compares two entities in a security-relevant context, but the comparison is incorrect.

Affected software

CVE-2024-53861 is recorded against 1 package.

  • pyjwt (from 2.10.0 up to 2.10.1)

Timeline and source

Published on 7 July 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)
github.com (Package)
pypi.org (Package)
github.com (Advisory)

Other advisories for this package

pyjwt has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-697: Incorrect Comparison) in other software:

CVE-2024-53861 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity LOW
CVSS Score 2.0
CVSS Vector CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
CWE CWE-697
Public Exploit ⚠️ Yes
Source OSV
Published 2026-07-07
Updated 2026-08-20
Modified 2026-07-07

Affected Packages

Software From version Fixed in
pyjwt 2.10.0 2.10.1

Exploit Protection

Are you running pyjwt?

CVE-2024-53861 carries CVSS 2.0 Low rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2024-53861 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2024