Skip to main content
← All vulnerabilities
CVE-2017-11424PYSEC-2017-24GHSA-R9JW-MWHQ-WP62

In PyJWT 1.5.0 and below the `invalid_strings` check in `HMACAlgorithm.prepare_key` does not account for all PEM encoded public keys.

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 1.5.1
None on Exploit-DB, Metasploit or GitHub

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.

Timeline

  1. CVE published
  2. Record last updated

Affected versions

  • n/a n/a

    Version range not reported

  • pyjwtPyPI

    fixed in 1.5.1

References 2

debian.org

GitHub · jpadilla/pyjwt