Authentication Bypass

Affecting pyjwt package, versions [,1.5.1)

Report new vulnerabilities
Do your applications use this vulnerable package? Test your applications

Overview

pyjwt is a JSON Web Token implementation in Python.

Affected versions of the package are vulnerable to Authentication Bypass. 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

Upgrade pyjwt to version 1.5.1 or higher.

References

CVSS Score

7.5
high severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    None
  • Integrity
    High
  • Availability
    None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Credit
Unknown
CVE
CVE-2017-11424
CWE
CWE-284
Snyk ID
SNYK-PYTHON-PYJWT-40693
Disclosed
21 Jun, 2017
Published
09 Nov, 2017