# CVE-2017-11424: PyJWT vulnerable to key confusion attacks

Source: https://junglewise.ai/threats/cve-2017-11424-pyjwt-vulnerable-to-key-confusion-attacks  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2017-08-24  
License: CC BY 4.0 with a link back

CVE-2017-11424 · Severity: low · CVSS 3 · Published 2017-08-24

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.

Technologies: [pyjwt (PyPI)](https://junglewise.ai/threats/technologies/pypi-pyjwt). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2017-11424 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2017-11424 being exploited in the wild.

**How severe is CVE-2017-11424?** Low severity, with a CVSS score of 3, published 24 August 2017.

**Which products and versions are affected?** pyjwt (PyPI) ECOSYSTEM:introduced=0,fixed=1.5.1.

**Is there a fix for CVE-2017-11424?** Yes. pyjwt (PyPI): upgrade to 1.5.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2017-11424?** Check whether you run pyjwt (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pyjwt (PyPI): upgrade to 1.5.1 or later

  ```sh
  pip install "pyjwt>=1.5.1"
  ```


## Affected products

- pyjwt (PyPI) ECOSYSTEM:introduced=0,fixed=1.5.1

## Identifiers

- CVE-2017-11424
- GHSA-r9jw-mwhq-wp62
- PYSEC-2017-24

## Related threats

- [PyJWT HS256/384/512 token forgery via empty HMAC key in oct JWK](https://junglewise.ai/threats/pyjwt-hs256-384-512-verify-accepts-empty-hmac-key-via-oct-jwk-pyjwk-a3ba63d2)
- [PyJWT decode() options-dict mutation enabling claim-verification bypass](https://junglewise.ai/threats/cve-2026-103001-pyjwt-decode-reintroduces-options-dict-mutation-enabling-silent)
- [PyJWT OKP algorithm key validation bypass](https://junglewise.ai/threats/cve-2026-102275-pyjwt-is-a-python-implementation-of-json-web-token-standards)
- [PyJWT unhandled ValueError in JWK Set parsing](https://junglewise.ai/threats/cve-2026-102274-pyjwt-is-a-python-implementation-of-json-web-token-standards)
- [PyJWT HMAC key validation bypass in HMACAlgorithm.prepare_key](https://junglewise.ai/threats/cve-2026-102273-pyjwt-is-a-python-implementation-of-json-web-token-standards)
