{"id":"CVE-2022-29217","published":"2022-05-24T14:10:10Z","modified":"2025-04-23T18:22:46Z","title":"Key confusion through non-blocklisted public key formats in PyJWT","vendor":"jpadilla","product":"pyjwt","tier":"tail","description":{"text":"PyJWT is a Python implementation of RFC 7519. PyJWT supports multiple different JWT signing algorithms. With JWT, an attacker submitting the JWT token can choose the used signing algorithm. The PyJWT library requires that the application chooses what algorithms are supported. The application can specify `jwt.algorithms.get_default_algorithms()` to get support for all algorithms, or specify a single algorithm. The issue is not that big as `algorithms=jwt.algorithms.get_default_algorithms()` has to be used. Users should upgrade to v2.4.0 to receive a patch for this issue. As a workaround, always be explicit with the algorithms that are accepted and expected when decoding.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.4,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01355,"percentile":0.72344,"provenance":"source"},"cwes":[{"id":"CWE-327","name":"Use of a Broken or Risky Cryptographic Algorithm"}],"references":[{"url":"https://github.com/jpadilla/pyjwt/security/advisories/GHSA-ffqj-6fqr-9h24","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/jpadilla/pyjwt/commit/9c528670c455b8d948aff95ed50e22940d1ad3fc","tags":["x_refsource_MISC"]},{"url":"https://github.com/jpadilla/pyjwt/releases/tag/2.4.0","tags":["x_refsource_MISC"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6HIYEYZRQEP6QTHT3EHH3RGFYJIHIMAO/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5PK7IQCBVNLYJEFTPHBBPFP72H4WUFNX/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://www.vicarius.io/vsociety/posts/risky-algorithms-algorithm-confusion-in-pyjwt-cve-2022-29217","tags":[]}],"priority":{"score":19.6,"factors":[{"name":"EPSS percentile","points":14.47},{"name":"CVSS severity","points":5.18}]},"vendorSlug":"jpadilla","affectedVersions":[{"vendor":"jpadilla","product":"pyjwt","versions":[">= 1.5.0, < 2.4.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-04-23T15:52:55.610736Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"pyjwt","vulnerableRanges":[">=1.5.0, <2.4.0"],"patched":["2.4.0"],"from":["GHSA-ffqj-6fqr-9h24","PYSEC-2022-202"],"provenance":"source"}],"summary":{"text":"A cryptographic key confusion flaw in the PyJWT Python library (jpadilla/pyjwt), which implements RFC 7519 JSON Web Tokens, lets a token's signing algorithm be chosen by the attacker because the library does not restrict which public key formats are accepted. Exploitation requires the application to pass the library's full default algorithm set (jwt.algorithms.get_default_algorithms()) to its decoding call rather than a single explicit algorithm, and an attacker with network access who can submit a crafted JWT to that application could forge tokens that the application accepts as valid.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:16:28Z"},"euvd":{"id":"EUVD-2022-0213","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-jpadilla-pyjwt-cve-2022-29217","children":[{"from":"CVE-2022-29217","to":"CVE-2026-102268","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["jwt/utils.py"],"commits":["https://github.com/jpadilla/pyjwt/commit/9c528670c455b8d948aff95ed50e22940d1ad3fc","https://github.com/jpadilla/pyjwt/commit/8b4e233a22206b34ec1186e912e75c0b2396ac07"],"basis":"shared function","functions":["raw_to_der_signature"]}]},{"from":"CVE-2022-29217","to":"CVE-2026-102270","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["jwt/utils.py"],"commits":["https://github.com/jpadilla/pyjwt/commit/9c528670c455b8d948aff95ed50e22940d1ad3fc","https://github.com/jpadilla/pyjwt/commit/8b4e233a22206b34ec1186e912e75c0b2396ac07"],"basis":"shared function","functions":["raw_to_der_signature"]}]},{"from":"CVE-2022-29217","to":"CVE-2024-33663","relation":"related","confidence":"low","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"related","quote":"This is similar to CVE-2022-29217.","from":"CVE.org","in":"CVE-2024-33663"}]},{"from":"CVE-2022-29217","to":"CVE-2024-37568","relation":"related","confidence":"low","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"related","quote":"(This is similar to CVE-2022-29217 and CVE-2024-33663.)","from":"CVE.org","in":"CVE-2024-37568"}]}]}}