Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. PyJWT
  4. ›
  5. CVE-2017-11424

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

May 13, 2022 (updated October 15, 2024)

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

  • github.com/advisories/GHSA-r9jw-mwhq-wp62
  • github.com/jpadilla/pyjwt
  • github.com/jpadilla/pyjwt/pull/277
  • github.com/pypa/advisory-database/tree/main/vulns/pyjwt/PYSEC-2017-24.yaml
  • nvd.nist.gov/vuln/detail/CVE-2017-11424

Code Behaviors & Features

Detect and mitigate CVE-2017-11424 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 1.5.1

Fixed versions

  • 1.5.1

Solution

Upgrade to version 1.5.1 or above.

Impact 7.5 HIGH

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Source file

pypi/PyJWT/CVE-2017-11424.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:45 +0000.