CVE-2022-39227
Python-jwt subject to Authentication Bypass by Spoofing
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
9.1
Python-jwt subject to Authentication Bypass by Spoofing
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.
- Record
CVE-2022-39227- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N - Weakness
- CWE-290
- Updated
- 2026-11-02
EUVDEUVD-2022-0219
9.1
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.
- Record
EUVD-2022-0219- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-5p8v-58qm-c7fp
9.3
python-jwt vulnerable to token forgery with new claims
Impact
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.
Patches
Users should upgrade to version 3.3.4 Fixed by: https://github.com/davedoesdev/python-jwt/commit/88ad9e67c53aa5f7c43ec4aa52ed34b7930068c9
Workarounds
None
References
Found by Tom Tervoort https://github.com/pypa/advisory-database/blob/main/vulns/python-jwt/PYSEC-2022-259.yaml
More information
The vulnerability allows an attacker, who possesses a single valid JWT, to create a new token with forged claims that the verify_jwt function will accept as valid.
The issue is caused by an inconsistency between the JWT parsers used by python-jwt and its dependency jwcrypto. By mixing compact and JSON representations, an attacker can trick jwcrypto of parsing different claims than those over which a signature is validated by jwcrypto.
Testing the fix has been added as an automated unit test to python-jwt.
If you have any questions or comments about this advisory, please open an issue in python-jwt
- Record
GHSA-5p8v-58qm-c7fp- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N - CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N - Weakness
- CWE-290
- Updated
- 2026-11-02
NVD
9.1
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.
- Record
CVE-2022-39227- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N - Weakness
- CWE-290
- Updated
- 2026-11-02
OSVAZL-11032
9.1
CVE-2022-39227 affecting package python-jwt for versions less than 2.4.0-2
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.
- Record
AZL-11032- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N - Updated
- 2026-11-02
OSV
9.1
Python-jwt subject to Authentication Bypass by Spoofing
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.
- Record
CVE-2022-39227- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N - Weakness
- CWE-290
- Updated
- 2026-11-02
OSVGHSA-5p8v-58qm-c7fp
9.3
python-jwt vulnerable to token forgery with new claims
Impact
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.
Patches
Users should upgrade to version 3.3.4 Fixed by: https://github.com/davedoesdev/python-jwt/commit/88ad9e67c53aa5f7c43ec4aa52ed34b7930068c9
Workarounds
None
References
Found by Tom Tervoort https://github.com/pypa/advisory-database/blob/main/vulns/python-jwt/PYSEC-2022-259.yaml
More information
The vulnerability allows an attacker, who possesses a single valid JWT, to create a new token with forged claims that the verify_jwt function will accept as valid.
The issue is caused by an inconsistency between the JWT parsers used by python-jwt and its dependency jwcrypto. By mixing compact and JSON representations, an attacker can trick jwcrypto of parsing different claims than those over which a signature is validated by jwcrypto.
Testing the fix has been added as an automated unit test to python-jwt.
If you have any questions or comments about this advisory, please open an issue in python-jwt
- Record
GHSA-5p8v-58qm-c7fp- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N - CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N - Weakness
- CWE-290
- Updated
- 2026-11-02
OSVPYSEC-2022-259 No score
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.
- Record
PYSEC-2022-259- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
python-jwtPyPI |
before 3.3.4 | 3.3.4 |
python-jwtAzure Linux:2 |
before 2.4.0-2 | 2.4.0-2 |
python-jwtPyPI |
before 3.3.4, plus listed versions 0.1.00.2.00.2.10.3.00.3.1 Show 36 moreShow less0.3.20.3.30.3.40.3.50.3.60.3.70.3.81.0.01.0.11.0.21.0.31.1.01.1.11.1.21.1.31.1.51.1.61.1.71.2.01.2.12.0.02.0.12.0.23.0.03.1.03.2.03.2.13.2.23.2.33.2.43.2.53.2.63.3.03.3.13.3.23.3.3 |
3.3.4 |
python-jwtPyPI |
3.0.0 up to 3.3.4, plus listed versions 3.3.03.1.03.2.03.2.13.2.2 Show 7 moreShow less3.2.33.2.43.2.53.2.63.3.13.3.23.3.3 |
3.3.4 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | NoSpaceAvailable/CVE-2022-39227 | 2024-03-28 |
| PoC in GitHub | melikesraoz/cve-2022-39227-jwt-auth-bypass-demo | 2026-04-27 |
| PoC in GitHub | user0x1337/CVE-2022-39227 | 2023-06-07 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-39227 is a critical vulnerability (CVSS 9.1) in Davedoesdev Python-jwt, published September 1, 2022. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 5.34%, the 92nd percentile. Fixed in python-jwt 3.3.4.
References
github.com/davedoesdev/python-jwt/security/advisories/GHSA-5p8v-58qm-c7fp
github.com/davedoesdev/python-jwt/commit/88ad9e67c53aa5f7c43ec4aa52ed34b7930068c9
github.com/pypa/advisory-database/blob/main/vulns/python-jwt/PYSEC-2022-259.yaml
vicarius.io/vsociety/posts/authentication-bypass-in-python-jwt
github.com/davedoesdev/python-jwt/commit/6c5075469847b9e8b6e5336077d989d77a4d2bf1
nvd.nist.gov/vuln/detail/CVE-2022-39227
github.com/advisories/GHSA-5p8v-58qm-c7fp
github.com/CVEProject/cvelistV5/tree/main/cves/2022/39xxx/CVE-2022-39227.json
github.com/davedoesdev/python-jwt