Lookup for vulnerable packages by Package URL.

Purlpkg:pypi/pyjwt@2.10.1
Typepypi
Namespace
Namepyjwt
Version2.10.1
Qualifiers
Subpath
Is_vulnerabletrue
Next_non_vulnerable_version2.12.0
Latest_non_vulnerable_version2.12.0
Affected_by_vulnerabilities
0
url VCID-shhe-tubm-f7f8
vulnerability_id VCID-shhe-tubm-f7f8
summary
PyJWT accepts unknown `crit` header extensions
## Summary

PyJWT does not validate the `crit` (Critical) Header Parameter defined in
RFC 7515 §4.1.11. When a JWS token contains a `crit` array listing
extensions that PyJWT does not understand, the library accepts the token
instead of rejecting it. This violates the **MUST** requirement in the RFC.

This is the same class of vulnerability as CVE-2025-59420 (Authlib),
which received CVSS 7.5 (HIGH).

---

## RFC Requirement

RFC 7515 §4.1.11:

> The "crit" (Critical) Header Parameter indicates that extensions to this
> specification and/or [JWA] are being used that **MUST** be understood and
> processed. [...] If any of the listed extension Header Parameters are
> **not understood and supported** by the recipient, then the **JWS is invalid**.

---

## Proof of Concept

```python
import jwt  # PyJWT 2.8.0
import hmac, hashlib, base64, json

# Construct token with unknown critical extension
header = {"alg": "HS256", "crit": ["x-custom-policy"], "x-custom-policy": "require-mfa"}
payload = {"sub": "attacker", "role": "admin"}

def b64url(data):
    return base64.urlsafe_b64encode(data).rstrip(b"=").decode()

h = b64url(json.dumps(header, separators=(",", ":")).encode())
p = b64url(json.dumps(payload, separators=(",", ":")).encode())
sig = b64url(hmac.new(b"secret", f"{h}.{p}".encode(), hashlib.sha256).digest())
token = f"{h}.{p}.{sig}"

# Should REJECT — x-custom-policy is not understood by PyJWT
try:
    result = jwt.decode(token, "secret", algorithms=["HS256"])
    print(f"ACCEPTED: {result}")
    # Output: ACCEPTED: {'sub': 'attacker', 'role': 'admin'}
except Exception as e:
    print(f"REJECTED: {e}")
```

**Expected:** `jwt.exceptions.InvalidTokenError: Unsupported critical extension: x-custom-policy`
**Actual:** Token accepted, payload returned.

### Comparison with RFC-compliant library

```python
# jwcrypto — correctly rejects
from jwcrypto import jwt as jw_jwt, jwk
key = jwk.JWK(kty="oct", k=b64url(b"secret"))
jw_jwt.JWT(jwt=token, key=key, algs=["HS256"])
# raises: InvalidJWSObject('Unknown critical header: "x-custom-policy"')
```

---

## Impact

- **Split-brain verification** in mixed-library deployments (e.g., API
  gateway using jwcrypto rejects, backend using PyJWT accepts)
- **Security policy bypass** when `crit` carries enforcement semantics
  (MFA, token binding, scope restrictions)
- **Token binding bypass** — RFC 7800 `cnf` (Proof-of-Possession) can be
  silently ignored
- See CVE-2025-59420 for full impact analysis

---

## Suggested Fix

In `jwt/api_jwt.py`, add validation in `_validate_headers()` or
`decode()`:

```python
_SUPPORTED_CRIT = {"b64"}  # Add extensions PyJWT actually supports

def _validate_crit(self, headers: dict) -> None:
    crit = headers.get("crit")
    if crit is None:
        return
    if not isinstance(crit, list) or len(crit) == 0:
        raise InvalidTokenError("crit must be a non-empty array")
    for ext in crit:
        if ext not in self._SUPPORTED_CRIT:
            raise InvalidTokenError(f"Unsupported critical extension: {ext}")
        if ext not in headers:
            raise InvalidTokenError(f"Critical extension {ext} not in header")
```

---

## CWE

- CWE-345: Insufficient Verification of Data Authenticity
- CWE-863: Incorrect Authorization

## References

- [RFC 7515 §4.1.11](https://www.rfc-editor.org/rfc/rfc7515.html#section-4.1.11)
- [CVE-2025-59420 — Authlib crit bypass (CVSS 7.5)](https://osv.dev/vulnerability/GHSA-9ggr-2464-2j32)
- [RFC 7800 — Proof-of-Possession Key Semantics](https://www.rfc-editor.org/rfc/rfc7800)
references
0
reference_url https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2026-32597.json
reference_id
reference_type
scores
0
value 7.5
scoring_system cvssv3
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
url https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2026-32597.json
1
reference_url https://api.first.org/data/v1/epss?cve=CVE-2026-32597
reference_id
reference_type
scores
0
value 0.0001
scoring_system epss
scoring_elements 0.01058
published_at 2026-04-13T12:55:00Z
1
value 0.0001
scoring_system epss
scoring_elements 0.01126
published_at 2026-04-21T12:55:00Z
2
value 0.0001
scoring_system epss
scoring_elements 0.01061
published_at 2026-04-18T12:55:00Z
3
value 0.0001
scoring_system epss
scoring_elements 0.01053
published_at 2026-04-16T12:55:00Z
4
value 0.00013
scoring_system epss
scoring_elements 0.02306
published_at 2026-04-24T12:55:00Z
5
value 0.00013
scoring_system epss
scoring_elements 0.02317
published_at 2026-05-05T12:55:00Z
6
value 0.00013
scoring_system epss
scoring_elements 0.02343
published_at 2026-04-29T12:55:00Z
7
value 0.00013
scoring_system epss
scoring_elements 0.02299
published_at 2026-04-26T12:55:00Z
8
value 0.00013
scoring_system epss
scoring_elements 0.0232
published_at 2026-05-07T12:55:00Z
9
value 9e-05
scoring_system epss
scoring_elements 0.0092
published_at 2026-04-08T12:55:00Z
10
value 9e-05
scoring_system epss
scoring_elements 0.00913
published_at 2026-04-02T12:55:00Z
11
value 9e-05
scoring_system epss
scoring_elements 0.00914
published_at 2026-04-04T12:55:00Z
12
value 9e-05
scoring_system epss
scoring_elements 0.00917
published_at 2026-04-09T12:55:00Z
13
value 9e-05
scoring_system epss
scoring_elements 0.00906
published_at 2026-04-11T12:55:00Z
14
value 9e-05
scoring_system epss
scoring_elements 0.00901
published_at 2026-04-12T12:55:00Z
url https://api.first.org/data/v1/epss?cve=CVE-2026-32597
2
reference_url https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-32597
reference_id
reference_type
scores
url https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-32597
3
reference_url https://ftp.suse.com/pub/projects/security/yaml/suse-cvss-scores.yaml
reference_id
reference_type
scores
0
value 7.5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
url https://ftp.suse.com/pub/projects/security/yaml/suse-cvss-scores.yaml
4
reference_url https://github.com/jpadilla/pyjwt
reference_id
reference_type
scores
0
value 7.5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://github.com/jpadilla/pyjwt
5
reference_url https://github.com/jpadilla/pyjwt/security/advisories/GHSA-752w-5fwx-jx9f
reference_id
reference_type
scores
0
value 7.5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
1
value HIGH
scoring_system cvssv3.1_qr
scoring_elements
2
value HIGH
scoring_system generic_textual
scoring_elements
3
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:Y/T:P/P:M/B:A/M:M/D:T/2026-03-13T14:48:42Z/
url https://github.com/jpadilla/pyjwt/security/advisories/GHSA-752w-5fwx-jx9f
6
reference_url https://lists.debian.org/debian-lts-announce/2026/05/msg00008.html
reference_id
reference_type
scores
0
value 7.5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://lists.debian.org/debian-lts-announce/2026/05/msg00008.html
7
reference_url https://nvd.nist.gov/vuln/detail/CVE-2026-32597
reference_id
reference_type
scores
0
value 7.5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
1
value HIGH
scoring_system generic_textual
scoring_elements
url https://nvd.nist.gov/vuln/detail/CVE-2026-32597
8
reference_url https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1130662
reference_id 1130662
reference_type
scores
url https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1130662
9
reference_url https://bugzilla.redhat.com/show_bug.cgi?id=2447194
reference_id 2447194
reference_type
scores
url https://bugzilla.redhat.com/show_bug.cgi?id=2447194
10
reference_url https://github.com/advisories/GHSA-752w-5fwx-jx9f
reference_id GHSA-752w-5fwx-jx9f
reference_type
scores
0
value HIGH
scoring_system cvssv3.1_qr
scoring_elements
url https://github.com/advisories/GHSA-752w-5fwx-jx9f
11
reference_url https://access.redhat.com/errata/RHSA-2026:10140
reference_id RHSA-2026:10140
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:10140
12
reference_url https://access.redhat.com/errata/RHSA-2026:10141
reference_id RHSA-2026:10141
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:10141
13
reference_url https://access.redhat.com/errata/RHSA-2026:10184
reference_id RHSA-2026:10184
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:10184
14
reference_url https://access.redhat.com/errata/RHSA-2026:12176
reference_id RHSA-2026:12176
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:12176
15
reference_url https://access.redhat.com/errata/RHSA-2026:13508
reference_id RHSA-2026:13508
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:13508
16
reference_url https://access.redhat.com/errata/RHSA-2026:13512
reference_id RHSA-2026:13512
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:13512
17
reference_url https://access.redhat.com/errata/RHSA-2026:13545
reference_id RHSA-2026:13545
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:13545
18
reference_url https://access.redhat.com/errata/RHSA-2026:13553
reference_id RHSA-2026:13553
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:13553
19
reference_url https://access.redhat.com/errata/RHSA-2026:13672
reference_id RHSA-2026:13672
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:13672
20
reference_url https://access.redhat.com/errata/RHSA-2026:13916
reference_id RHSA-2026:13916
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:13916
21
reference_url https://access.redhat.com/errata/RHSA-2026:6568
reference_id RHSA-2026:6568
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:6568
22
reference_url https://access.redhat.com/errata/RHSA-2026:6720
reference_id RHSA-2026:6720
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:6720
23
reference_url https://access.redhat.com/errata/RHSA-2026:6912
reference_id RHSA-2026:6912
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:6912
24
reference_url https://access.redhat.com/errata/RHSA-2026:6926
reference_id RHSA-2026:6926
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:6926
25
reference_url https://access.redhat.com/errata/RHSA-2026:8437
reference_id RHSA-2026:8437
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:8437
26
reference_url https://access.redhat.com/errata/RHSA-2026:8746
reference_id RHSA-2026:8746
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:8746
27
reference_url https://access.redhat.com/errata/RHSA-2026:8747
reference_id RHSA-2026:8747
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:8747
28
reference_url https://access.redhat.com/errata/RHSA-2026:8748
reference_id RHSA-2026:8748
reference_type
scores
url https://access.redhat.com/errata/RHSA-2026:8748
29
reference_url https://usn.ubuntu.com/8133-1/
reference_id USN-8133-1
reference_type
scores
url https://usn.ubuntu.com/8133-1/
fixed_packages
0
url pkg:pypi/pyjwt@2.12.0
purl pkg:pypi/pyjwt@2.12.0
is_vulnerable false
affected_by_vulnerabilities
resource_url http://public2.vulnerablecode.io/packages/pkg:pypi/pyjwt@2.12.0
aliases CVE-2026-32597, GHSA-752w-5fwx-jx9f
risk_score 4.0
exploitability 0.5
weighted_severity 8.0
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-shhe-tubm-f7f8
Fixing_vulnerabilities
0
url VCID-5zts-netw-syay
vulnerability_id VCID-5zts-netw-syay
summary
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.
references
0
reference_url https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2024-53861.json
reference_id
reference_type
scores
0
value 2.2
scoring_system cvssv3
scoring_elements CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:L
url https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2024-53861.json
1
reference_url https://api.first.org/data/v1/epss?cve=CVE-2024-53861
reference_id
reference_type
scores
0
value 0.01019
scoring_system epss
scoring_elements 0.77332
published_at 2026-05-07T12:55:00Z
1
value 0.01019
scoring_system epss
scoring_elements 0.77303
published_at 2026-05-05T12:55:00Z
2
value 0.01019
scoring_system epss
scoring_elements 0.77298
published_at 2026-04-29T12:55:00Z
3
value 0.01019
scoring_system epss
scoring_elements 0.77283
published_at 2026-04-26T12:55:00Z
4
value 0.01019
scoring_system epss
scoring_elements 0.77278
published_at 2026-04-24T12:55:00Z
5
value 0.01019
scoring_system epss
scoring_elements 0.77211
published_at 2026-04-13T12:55:00Z
6
value 0.01019
scoring_system epss
scoring_elements 0.77244
published_at 2026-04-21T12:55:00Z
7
value 0.01019
scoring_system epss
scoring_elements 0.77253
published_at 2026-04-18T12:55:00Z
8
value 0.01019
scoring_system epss
scoring_elements 0.77156
published_at 2026-04-02T12:55:00Z
9
value 0.01019
scoring_system epss
scoring_elements 0.77185
published_at 2026-04-04T12:55:00Z
10
value 0.01019
scoring_system epss
scoring_elements 0.77251
published_at 2026-04-16T12:55:00Z
11
value 0.01019
scoring_system epss
scoring_elements 0.77167
published_at 2026-04-07T12:55:00Z
12
value 0.01019
scoring_system epss
scoring_elements 0.77199
published_at 2026-04-08T12:55:00Z
13
value 0.01019
scoring_system epss
scoring_elements 0.77208
published_at 2026-04-09T12:55:00Z
14
value 0.01019
scoring_system epss
scoring_elements 0.77236
published_at 2026-04-11T12:55:00Z
15
value 0.01019
scoring_system epss
scoring_elements 0.77215
published_at 2026-04-12T12:55:00Z
url https://api.first.org/data/v1/epss?cve=CVE-2024-53861
2
reference_url https://github.com/jpadilla/pyjwt
reference_id
reference_type
scores
0
value 2.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
1
value 2.1
scoring_system cvssv4
scoring_elements 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
2
value LOW
scoring_system generic_textual
scoring_elements
url https://github.com/jpadilla/pyjwt
3
reference_url https://github.com/jpadilla/pyjwt/commit/1570e708672aa9036bc772476beae8bfa48f4131#diff-6893ad4a1c5a36b8af3028db8c8bc3b62418149843fc382faf901eaab008e380R366
reference_id
reference_type
scores
0
value 2.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
1
value 2.1
scoring_system cvssv4
scoring_elements 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
2
value LOW
scoring_system generic_textual
scoring_elements
3
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2024-12-02T11:10:51Z/
url https://github.com/jpadilla/pyjwt/commit/1570e708672aa9036bc772476beae8bfa48f4131#diff-6893ad4a1c5a36b8af3028db8c8bc3b62418149843fc382faf901eaab008e380R366
4
reference_url https://github.com/jpadilla/pyjwt/commit/33022c25525c1020869c71ce2a4109e44ae4ced1
reference_id
reference_type
scores
0
value 2.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
1
value 2.1
scoring_system cvssv4
scoring_elements 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
2
value LOW
scoring_system generic_textual
scoring_elements
3
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2024-12-02T11:10:51Z/
url https://github.com/jpadilla/pyjwt/commit/33022c25525c1020869c71ce2a4109e44ae4ced1
5
reference_url https://github.com/jpadilla/pyjwt/security/advisories/GHSA-75c5-xw7c-p5pm
reference_id
reference_type
scores
0
value 2.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
1
value LOW
scoring_system cvssv3.1_qr
scoring_elements
2
value 2.1
scoring_system cvssv4
scoring_elements 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
3
value LOW
scoring_system generic_textual
scoring_elements
4
value Track
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2024-12-02T11:10:51Z/
url https://github.com/jpadilla/pyjwt/security/advisories/GHSA-75c5-xw7c-p5pm
6
reference_url https://nvd.nist.gov/vuln/detail/CVE-2024-53861
reference_id
reference_type
scores
0
value 2.2
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N
1
value 2.1
scoring_system cvssv4
scoring_elements 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
2
value LOW
scoring_system generic_textual
scoring_elements
url https://nvd.nist.gov/vuln/detail/CVE-2024-53861
7
reference_url https://bugzilla.redhat.com/show_bug.cgi?id=2329527
reference_id 2329527
reference_type
scores
url https://bugzilla.redhat.com/show_bug.cgi?id=2329527
8
reference_url https://github.com/advisories/GHSA-75c5-xw7c-p5pm
reference_id GHSA-75c5-xw7c-p5pm
reference_type
scores
0
value LOW
scoring_system cvssv3.1_qr
scoring_elements
url https://github.com/advisories/GHSA-75c5-xw7c-p5pm
fixed_packages
0
url pkg:pypi/pyjwt@2.10.1
purl pkg:pypi/pyjwt@2.10.1
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-shhe-tubm-f7f8
resource_url http://public2.vulnerablecode.io/packages/pkg:pypi/pyjwt@2.10.1
aliases CVE-2024-53861, GHSA-75c5-xw7c-p5pm
risk_score 1.4
exploitability 0.5
weighted_severity 2.7
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-5zts-netw-syay
Risk_score4.0
Resource_urlhttp://public2.vulnerablecode.io/packages/pkg:pypi/pyjwt@2.10.1