Bug 1482529 (CVE-2017-11424)

Summary: CVE-2017-11424 python-jwt: Incorrect handling of PEM-encoded public keys
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: infra-sig, oalbrigt, rbean, sisharma, smohan, ssaha, vbellur
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-jwt 1.5.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-19 13:31:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1482530, 1482531, 1483435, 1526430    
Bug Blocks: 1482533    

Description Adam Mariš 2017-08-17 13:27:42 UTC
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.

Upstream bug:

https://github.com/jpadilla/pyjwt/pull/277

Comment 1 Adam Mariš 2017-08-17 13:27:59 UTC
Created python-jwt tracking bugs for this issue:

Affects: epel-7 [bug 1482530]
Affects: fedora-all [bug 1482531]

Comment 3 Adam Mariš 2017-08-25 08:17:31 UTC
CVE-2017-12880 was rejected in favour of CVE-2017-11424.

Comment 4 Siddharth Sharma 2017-10-09 03:49:38 UTC
Analysis:

Python-jwt is shipped as dependency for heketi in Red Hat Gluster Storage 3. Heketi only uses token signatures (used algorithm HMAC HS256). Python-jwt is affected by this CVE but it does not affect Red Hat Gluster Storage 3 in the way it is being used.