CVE-2024-53861
Low · 2.2PyJWT Issuer field partial matches allowed
CVSS
2.2
EPSS
0.8%
Published
Dec 2, 2024
CISA due date
—
Cloudanix analysis
A coding mistake in a popular JWT library lets attackers trick applications into accepting fake identity tokens that should have been rejected.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Privilege Gain
- Component
- Library
- Class
- Authentication Bypass
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- Low
What it actually does
Incorrect string comparison logic during JWT 'iss' claim validation accepts partial/substring matches (e.g., 'acb' accepted for expected '_abc_'), bypassing intended issuer verification.
Why it matters to the business
Attackers may obtain unauthorized access to resources protected by JWT-based authentication in applications using the vulnerable PyJWT library, though the flaw is narrow in scope.
How an attack unfolds
An attacker generates a JWT token containing an 'iss' claim value that is a substring or partial match of the expected issuer string, submits it to an application endpoint relying on PyJWT for validation, and gains access because the flawed check passes the token as valid.
How to fix it
Upgrade jpadilla/pyjwt to the commit 33022c25525c1020869e71ce2a4109e44ae4ced1 or later release containing the corrected 'iss' string comparison logic.
How to confirm the fix worked
Verify the installed PyJWT version or source tree contains commit 33022c25525c1020869e71ce2a4109e44ae4ced1; re-run unit tests covering 'iss' claim validation with both exact and partial issuer strings to confirm rejection of mismatches.
Typical attack path
- Identify an application endpoint that accepts and validates PyJWT-signed tokens for authentication or authorization.
- Craft a JWT with a forged 'iss' claim using a partial match of the legitimate issuer string.
- Submit the token in an authentication request or API call.
- Bypass issuer validation and obtain a valid session or resource access.
How to detect it
Search application and authentication logs for JWT tokens where the 'iss' claim value is accepted despite not exactly matching the configured expected issuer string; inspect token validation paths in code for the flawed comparison.
What your security team should do
- Immediately audit all applications for use of PyJWT and schedule upgrade to the fixed commit.
- Review JWT validation code for any custom 'iss' handling that may compound the issue.
- Monitor authentication logs for unexpected issuer values until patches are applied.
The record
The wrong string if check is run for `iss` checking, resulting in `"acb"` being accepted for `"_abc_"`.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | pyjwt | 2.10.0 | 2.10.1 |
| Chainguard | az | 0 | 2.67.0-r1 |
| Chainguard | az-iamguarded-compat | 0 | 2.67.0-r1 |
| Chainguard | barman | 0 | 3.12.1-r0 |
| Chainguard | barman-cloudnative-pg | 0 | 3.12.1-r0 |
| Chainguard | py3-pyjwt | 0 | 2.10.1-r0 |
| Chainguard | py3.10-pyjwt | 0 | 2.10.1-r0 |
| Chainguard | py3.11-pyjwt | 0 | 2.10.1-r0 |
| Chainguard | py3.12-pyjwt | 0 | 2.10.1-r0 |
| Chainguard | py3.13-pyjwt | 0 | 2.10.1-r0 |
| Ubuntu:20.04:LTS | pyjwt | 0 | No fix |
| Ubuntu:22.04:LTS | pyjwt | 0 | No fix |
| Ubuntu:24.04:LTS | pyjwt | 0 | No fix |
| Ubuntu:24.10 | pyjwt | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | pyjwt | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | pyjwt | 0 | No fix |
| Wolfi | az | 0 | 2.67.0-r1 |
| Wolfi | az-iamguarded-compat | 0 | 2.67.0-r1 |
| Wolfi | py3-pyjwt | 0 | 2.10.1-r0 |
| Wolfi | py3.10-pyjwt | 0 | 2.10.1-r0 |
| Wolfi | py3.11-pyjwt | 0 | 2.10.1-r0 |
| Wolfi | py3.12-pyjwt | 0 | 2.10.1-r0 |
| Wolfi | py3.13-pyjwt | 0 | 2.10.1-r0 |
| openSUSE:Tumbleweed | python-PyJWT | 0 | 2.10.1-1.1 |
| pypi | PyJWT | 2.10.0 | No fix |
Related vulnerabilities
- CVE-2017-11424 In PyJWT 1.5.0 and below the `invalid_strings` check in `HMACAlgorithm.prepare_key` does… Also affects pyjwt
- CVE-2026-25645 Requests is a HTTP library. Also affects az
- CVE-2026-4539 A security flaw has been discovered in pygments up to 2.19.2. Also affects az
- CVE-2026-27448 pyOpenSSL is a Python wrapper around the OpenSSL library. Also affects az
- CVE-2026-27459 pyOpenSSL is a Python wrapper around the OpenSSL library. Also affects az
- CVE-2026-32597 PyJWT is a JSON Web Token implementation in Python. Also affects az
- CVE-2026-21226 Deserialization of untrusted data in Azure Core shared client library for Python allows… Also affects az
- CVE-2026-21441 Decompression-bomb safeguards bypassed when following HTTP redirects (streaming API) Also affects az