CVE-2017-11424
PyJWT vulnerable to key confusion attacks
Reported by duo · Published August 24, 2017
pyjwt is fixed in 1.5.1 (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| pyjwt | PyPI | 1.5.1 |
| pyjwt | pyjwt_project | 1.5.0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | n/a | n/a |
| PyPI | PyJWT | 0 |
| n/a | n/a | * |
Timeline
- Aug 24, 2017 CVE Published
- Apr 14, 2021 EPSS Score (30 in total, the first dated here)
- Jul 16, 2025 CVE Updated
- Mar 5, 2026 Distribution Patch (2 in total, the first dated here)
- Mar 5, 2026 Security Advisory (3 in total, the first dated here)
- Oct 4, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2017-11424
vulnetix vdb fixes CVE-2017-11424
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2017-11424/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- DSA-3979 vendor-advisoryx_refsource_DEBIAN
- x_refsource_CONFIRM
- https://nvd.nist.gov/vuln/detail/CVE-2017-11424 advisory
- https://github.com/advisories/GHSA-r9jw-mwhq-wp62 advisory
- https://github.com/jpadilla/pyjwt url
- https://github.com/pypa/advisory-database/tree/main/vulns/pyjwt/PYSEC-2017-24.yaml advisory