Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1yOWp3LW13aHEtd3A2Ms4AAR9d

PyJWT vulnerable to key confusion attacks

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.

Permalink: https://github.com/advisories/GHSA-r9jw-mwhq-wp62
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1yOWp3LW13aHEtd3A2Ms4AAR9d
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: over 2 years ago
Updated: about 2 months ago


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

Identifiers: GHSA-r9jw-mwhq-wp62, CVE-2017-11424
References: Repository: https://github.com/jpadilla/pyjwt
Blast Radius: 34.1

Affected Packages

pypi:pyjwt
Dependent packages: 1,012
Dependent repositories: 34,706
Downloads: 198,640,193 last month
Affected Version Ranges: < 1.5.1
Fixed in: 1.5.1
All affected versions: 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.3, 0.3.0, 0.3.1, 0.3.2, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 1.0.0, 1.0.1, 1.1.0, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 1.5.0
All unaffected versions: 1.5.1, 1.5.2, 1.5.3, 1.6.0, 1.6.1, 1.6.3, 1.6.4, 1.7.0, 1.7.1, 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.3.0, 2.4.0, 2.5.0, 2.6.0, 2.7.0, 2.8.0, 2.9.0, 2.10.0, 2.10.1