Lookup for vulnerable packages by Package URL.

Purlpkg:pypi/pyjwt@0.4.2
Typepypi
Namespace
Namepyjwt
Version0.4.2
Qualifiers
Subpath
Is_vulnerabletrue
Next_non_vulnerable_version2.12.0
Latest_non_vulnerable_version2.12.0
Affected_by_vulnerabilities
0
url VCID-42yf-7k7m-dkf6
vulnerability_id VCID-42yf-7k7m-dkf6
summary In PyJWT 1.5.0 and below the `invalid_strings` check in `HMACAlgorithm.prepare_key` does not account for all PEM encoded public keys. Specifically, the PKCS1 PEM encoded format would be allowed because it is prefaced with the string `-----BEGIN RSA PUBLIC KEY-----` which is not accounted for. This enables symmetric/asymmetric key confusion attacks against users using the PKCS1 PEM encoded public keys, which would allow an attacker to craft JWTs from scratch.
references
0
reference_url https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2017-11424.json
reference_id
reference_type
scores
0
value 5.3
scoring_system cvssv3
scoring_elements CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
url https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2017-11424.json
1
reference_url https://api.first.org/data/v1/epss?cve=CVE-2017-11424
reference_id
reference_type
scores
0
value 0.00193
scoring_system epss
scoring_elements 0.40938
published_at 2026-04-29T12:55:00Z
1
value 0.00193
scoring_system epss
scoring_elements 0.41021
published_at 2026-04-26T12:55:00Z
2
value 0.00525
scoring_system epss
scoring_elements 0.67031
published_at 2026-04-24T12:55:00Z
3
value 0.00525
scoring_system epss
scoring_elements 0.67011
published_at 2026-04-21T12:55:00Z
4
value 0.00847
scoring_system epss
scoring_elements 0.74881
published_at 2026-04-18T12:55:00Z
5
value 0.00847
scoring_system epss
scoring_elements 0.74873
published_at 2026-04-16T12:55:00Z
6
value 0.01288
scoring_system epss
scoring_elements 0.79597
published_at 2026-04-02T12:55:00Z
7
value 0.01288
scoring_system epss
scoring_elements 0.7959
published_at 2026-04-01T12:55:00Z
8
value 0.01288
scoring_system epss
scoring_elements 0.79619
published_at 2026-04-04T12:55:00Z
9
value 0.01288
scoring_system epss
scoring_elements 0.79606
published_at 2026-04-07T12:55:00Z
10
value 0.01288
scoring_system epss
scoring_elements 0.79634
published_at 2026-04-08T12:55:00Z
11
value 0.01288
scoring_system epss
scoring_elements 0.79643
published_at 2026-04-09T12:55:00Z
12
value 0.01288
scoring_system epss
scoring_elements 0.79663
published_at 2026-04-11T12:55:00Z
13
value 0.01288
scoring_system epss
scoring_elements 0.79648
published_at 2026-04-12T12:55:00Z
14
value 0.01288
scoring_system epss
scoring_elements 0.7964
published_at 2026-04-13T12:55:00Z
url https://api.first.org/data/v1/epss?cve=CVE-2017-11424
2
reference_url https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11424
reference_id
reference_type
scores
url https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11424
3
reference_url https://github.com/advisories/GHSA-r9jw-mwhq-wp62
reference_id
reference_type
scores
0
value HIGH
scoring_system cvssv3.1_qr
scoring_elements
url https://github.com/advisories/GHSA-r9jw-mwhq-wp62
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.0/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/pull/277
reference_id
reference_type
scores
0
value 7.5
scoring_system cvssv3.1
scoring_elements CVSS:3.0/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/pull/277
6
reference_url https://github.com/pypa/advisory-database/tree/main/vulns/pyjwt/PYSEC-2017-24.yaml
reference_id
reference_type
scores
0
value 7.5
scoring_system cvssv3.1
scoring_elements CVSS:3.0/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/pypa/advisory-database/tree/main/vulns/pyjwt/PYSEC-2017-24.yaml
7
reference_url http://www.debian.org/security/2017/dsa-3979
reference_id
reference_type
scores
0
value 7.5
scoring_system cvssv3.1
scoring_elements CVSS:3.0/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 http://www.debian.org/security/2017/dsa-3979
8
reference_url https://bugzilla.redhat.com/show_bug.cgi?id=1482529
reference_id 1482529
reference_type
scores
url https://bugzilla.redhat.com/show_bug.cgi?id=1482529
9
reference_url https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873244
reference_id 873244
reference_type
scores
url https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873244
10
reference_url https://nvd.nist.gov/vuln/detail/CVE-2017-11424
reference_id CVE-2017-11424
reference_type
scores
0
value 7.5
scoring_system cvssv3.1
scoring_elements CVSS:3.0/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-2017-11424
11
reference_url https://usn.ubuntu.com/3407-1/
reference_id USN-3407-1
reference_type
scores
url https://usn.ubuntu.com/3407-1/
fixed_packages
0
url pkg:pypi/pyjwt@1.5.1
purl pkg:pypi/pyjwt@1.5.1
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-dq17-gzkv-1bdb
1
vulnerability VCID-shhe-tubm-f7f8
resource_url http://public2.vulnerablecode.io/packages/pkg:pypi/pyjwt@1.5.1
aliases CVE-2017-11424, GHSA-r9jw-mwhq-wp62, PYSEC-2017-24
risk_score 4.0
exploitability 0.5
weighted_severity 8.0
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-42yf-7k7m-dkf6
1
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.01053
published_at 2026-04-16T12: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.01058
published_at 2026-04-13T12:55:00Z
4
value 0.00013
scoring_system epss
scoring_elements 0.02299
published_at 2026-04-26T12:55:00Z
5
value 0.00013
scoring_system epss
scoring_elements 0.02306
published_at 2026-04-24T12:55:00Z
6
value 0.00013
scoring_system epss
scoring_elements 0.02343
published_at 2026-04-29T12:55:00Z
7
value 9e-05
scoring_system epss
scoring_elements 0.00914
published_at 2026-04-04T12:55:00Z
8
value 9e-05
scoring_system epss
scoring_elements 0.00913
published_at 2026-04-02T12:55:00Z
9
value 9e-05
scoring_system epss
scoring_elements 0.00917
published_at 2026-04-09T12:55:00Z
10
value 9e-05
scoring_system epss
scoring_elements 0.0092
published_at 2026-04-08T12:55:00Z
11
value 9e-05
scoring_system epss
scoring_elements 0.00906
published_at 2026-04-11T12:55:00Z
12
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://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
7
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
8
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
9
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
10
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
11
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
12
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
13
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
14
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
15
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
16
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
17
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
18
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
19
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
20
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
21
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
22
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
2
url VCID-up5n-d12g-u3g6
vulnerability_id VCID-up5n-d12g-u3g6
summary
JWT Verification bypass
It is possible for an attacker to bypass verification when "a token digitally signed with an asymetric key (RS/ES family) of algorithms but instead the attacker send a token digitally signed with a symmetric algorithm (HS* family)". It is also possible for an attacker to create his own signed token with any payload he wants and have it considered valid using the "none" algorithm.
references
0
reference_url https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/
reference_id
reference_type
scores
url https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/
1
reference_url https://github.com/jpadilla/pyjwt/commit/88a9fc56bdc6c870aa6af93bda401414a217db2a
reference_id
reference_type
scores
url https://github.com/jpadilla/pyjwt/commit/88a9fc56bdc6c870aa6af93bda401414a217db2a
fixed_packages
0
url pkg:pypi/pyjwt@1.0.0
purl pkg:pypi/pyjwt@1.0.0
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-42yf-7k7m-dkf6
1
vulnerability VCID-shhe-tubm-f7f8
resource_url http://public2.vulnerablecode.io/packages/pkg:pypi/pyjwt@1.0.0
aliases GMS-2015-6
risk_score null
exploitability 0.5
weighted_severity 0.0
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-up5n-d12g-u3g6
Fixing_vulnerabilities
Risk_score4.0
Resource_urlhttp://public2.vulnerablecode.io/packages/pkg:pypi/pyjwt@0.4.2