Every CVE Search/ Get API key

CVE-2024-53861

Issuer field partial matches allowed in pyjwt

2.2 LowFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
High
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
Low
Availability
None

Exploit likelihood

0.83%Up 0.8 points since Nov 30, 2024
90%50%10%1%

What each source reports

CVE List Score used 2.2

Issuer field partial matches allowed in pyjwt

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.

Record
CVE-2024-53861
CVSS 3.1
2.2 LowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-697
Updated
2026-11-02
EUVDEUVD-2024-3440 2.2

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.

Record
EUVD-2024-3440
CVSS 3.1
2.2 LowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
Updated
2026-11-03
GitHub AdvisoriesGHSA-75c5-xw7c-p5pm 2.1

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: checking the "iss" claim changed from isinstance(issuer, list) to isinstance(issuer, Sequence).

-        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

        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.

Record
GHSA-75c5-xw7c-p5pm
CVSS 4.0
2.1 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
2.2 LowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-697
Updated
2026-11-02
NVD 2.2

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.

Record
CVE-2024-53861
CVSS 3.1
2.2 LowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-697
Updated
2026-11-02
OSVBELL-CVE-2024-53861 7.5

CVE-2024-53861 does not affect BellSoft software

Record
BELL-CVE-2024-53861
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSV 2.2

Issuer field partial matches allowed in pyjwt

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.

Record
CVE-2024-53861
CVSS 3.1
2.2 LowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-697
Updated
2026-11-02
Show 4 moreShow less
OSVGHSA-75c5-xw7c-p5pm 2.1

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: checking the "iss" claim changed from isinstance(issuer, list) to isinstance(issuer, Sequence).

-        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

        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.

Record
GHSA-75c5-xw7c-p5pm
CVSS 4.0
2.1 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
2.2 LowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
Weakness
CWE-697
Updated
2026-11-02
OSVPYSEC-2026-1814 2.1

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: checking the "iss" claim changed from isinstance(issuer, list) to isinstance(issuer, Sequence).

-        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

        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.

Record
PYSEC-2026-1814
CVSS 4.0
2.1 LowCVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
2.2 LowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
Updated
2026-11-02
OSVopenSUSE-SU-2024:14540-1 No score

python310-PyJWT-2.10.1-1.1 on GA media

These are all security issues fixed in the python310-PyJWT-2.10.1-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:14540-1
Updated
2026-11-02
OSVSUSE-SU-2026:20879-1 No score

Security update for python-PyJWT

This update for python-PyJWT fixes the following issues:

Update to PyJWT 2.12.1:

  • CVE-2024-53861: prevent partial matching of the Issuer field (bsc#1234038).
  • CVE-2026-32597: validate the crit Header Parameter defined in RFC 7515 (bsc#1259616).

Changelog:

Update to 2.12.1:

  • Add missing typing_extensions dependency for Python < 3.11 in #1150

Update to 2.12.0:

  • Annotate PyJWKSet.keys for pyright by @tamird in #1134
  • Close HTTPError response to prevent ResourceWarning on Python 3.14 by @veeceey in #1133
  • Do not keep algorithms dict in PyJWK instances by @akx in #1143
  • Use PyJWK algorithm when encoding without explicit algorithm in #1148
  • Docs: Add PyJWKClient API reference and document the two-tier caching system (JWK Set cache and signing key LRU cache).

Update to 2.11.0:

  • Enforce ECDSA curve validation per RFC 7518 Section 3.4.
  • Fix build system warnings by @kurtmckee in #1105
  • Validate key against allowed types for Algorithm family in #964
  • Add iterator for JWKSet in #1041
  • Validate iss claim is a string during encoding and decoding by @pachewise in #1040
  • Improve typing/logic for options in decode, decode_complete by @pachewise in #1045
  • Declare float supported type for lifespan and timeout by @nikitagashkov in #1068
  • Fix SyntaxWarnings/DeprecationWarnings caused by invalid escape sequences by @kurtmckee in #1103
  • Development: Build a shared wheel once to speed up test suite setup times by @kurtmckee in #1114
  • Development: Test type annotations across all supported Python versions, increase the strictness of the type checking, and remove the mypy pre-commit hook by @kurtmckee in #1112
  • Support Python 3.14, and test against PyPy 3.10 and 3.11 by @kurtmckee in #1104
  • Development: Migrate to build to test package building in CI by @kurtmckee in #1108
  • Development: Improve coverage config and eliminate unused test suite code by @kurtmckee in #1115
  • Docs: Standardize CHANGELOG links to PRs by @kurtmckee in #1110
  • Docs: Fix Read the Docs builds by @kurtmckee in #1111
  • Docs: Add example of using leeway with nbf by @djw8605 in #1034
  • Docs: Refactored docs with autodoc; added PyJWS and jwt.algorithms docs by @pachewise in #1045
  • Docs: Documentation improvements for "sub" and "jti" claims by @cleder in #1088
  • Development: Add pyupgrade as a pre-commit hook by @kurtmckee in #1109
  • Add minimum key length validation for HMAC and RSA keys (CWE-326). Warns by default via InsecureKeyLengthWarning when keys are below minimum recommended lengths per RFC 7518 Section 3.2 (HMAC) and NIST SP 800-131A (RSA). Pass enforce_minimum_key_length=True in options to PyJWT or PyJWS to raise InvalidKeyError instead.
  • Refactor PyJWT to own an internal PyJWS instance instead of calling global api_jws functions.

Update to 2.10.0:

  • chore: use sequence for typing rather than list
  • Add support for Python 3.13
  • [pre-commit.ci] pre-commit autoupdate
  • Add an RTD config file to resolve RTD build failures
  • docs: Update iat exception docs
  • Remove algorithm requirement for JWT API
  • Create SECURITY.md
  • docs fix: decode_complete scope and algorithms
  • fix doctest for docs/usage.rst
  • fix test_utils.py not to xfail
  • Correct jwt.decode audience param doc expression
  • Add PS256 encoding and decoding usage
  • Add API docs for PyJWK
  • Refactor project configuration files from setup.cfg to pyproject.toml PEP-518
  • Add JWK support to JWT encode
  • Update pre-commit hooks to lint pyproject.toml
  • Add EdDSA algorithm encoding/decoding usage
  • Ruff linter and formatter changes
  • Validate sub and jti claims for the token
  • Add ES256 usage
  • Encode EC keys with a fixed bit length
  • Drop support for Python 3.8
  • Prepare 2.10.0 release
  • Bump codecov/codecov-action from 4 to 5
Record
SUSE-SU-2026:20879-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
pyjwt
PyPI
2.10.0 to 2.10.0
2.10.1
pyjwt
PyPI
2.10.0 up to 2.10.1
2.10.1
python-PyJWT
SUSE:Linux Micro 6.1
From an advisory covering 2 CVEs
before 2.12.1-slfo.1.1_1.1
2.12.1-slfo.1.1_1.1
python-PyJWT
openSUSE:Tumbleweed
before 2.10.1-1.1
2.10.1-1.1

History

History
RecordedChangedSources
affected, facts
aliases, publishedEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-53861 is a low vulnerability (CVSS 2.2) in Jpadilla Pyjwt, published November 29, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.83%, the 57th percentile. Fixed in pyjwt 2.10.1.

References

Show 8 moreShow less
MoveEnter Open