CVE-2017-11424

python-jwt: Incorrect handling of PEM-encoded public keys

Published Aug 24, 2017 CVSS 3.0 · 7.5 High EPSS 1.8% KEV · Not listed
Description
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DSA Debian DSA DSA-3979-1 pyjwt security update
EUVD EUVD EUVD-2017-0103 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.
Github GHSA Github GHSA GHSA-r9jw-mwhq-wp62 PyJWT vulnerable to key confusion attacks
Ubuntu USN Ubuntu USN USN-3407-1 PyJWT vulnerability
History

No history.

Weaknesses

Sources

Status
PUBLISHED
Assigner
duo
Published
Updated
Aug 5, 2024, 6:12 PM
Reserved
Jul 18, 2017, 12:00 AM
Status
Modified
Published
Aug 24, 2017, 4:29 PM
Modified
Jun 17, 2026, 1:01 AM
Severity
Moderate
Public date
Jun 22, 2017, 12:00 AM