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

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). 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
    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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.