Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2022-3102

MEDIUM

jwcrypto token substitution can lead to authentication bypass

Also known as GHSA-gwp4-mcv4-w95j, PYSEC-2026-827

Mitigation

  • Upgrade jwcrypto to 1.4 or later.

Who should check

  • Projects that depend on PyPI package jwcrypto (< 1.4)

Vulnerability facts

Affected
jwcrypto < 1.4
Fixed in
1.4
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Unknown
CVSS
Not scored yet
Published
Modified

Description

The JWT code can auto-detect the type of token being provided, and this can lead the application to incorrect conclusions about the trustworthiness of the token. Quoting the private disclosure we received : "Under certain circumstances, it is possible to substitute a [..] signed JWS with a JWE that is encrypted with the public key that is normally used for signature validation." This substitution attack can occur only if the validating application also have access to the private key, normally used to sign the tokens, available during validation of the received JWT. The significance of this attacks depends on the use of the token, it may lead to authentication bypass or authorization bypass (respectively if claims are used to authenticate or authorize certain actions), because the attacker has full control of the data placed in the JWE and can inject any desired claim value. Several mitigating factors exist that can protect applications from this issue: - If the private key corresponding to the public key used to encrypt the JWE is not available to the application an exception will be raised. - If the JWK is specified with the 'use' parameter set to 'sig' (as expected for keys used only for signing/verification) an exception will be raised. - If the JWK is specified with the 'key_ops' parameter set and it does not include the 'decrypt' operation an exception will be raised. - Applications may check the token type before validation, in this case they would fail to detect an expected JWS Normally, signing and validation are done by different applications, so this scenario should be unlikely. However it is possible to have applications that both sign and validate tokens and do not separate JWKs in use, or do not set a JWK 'use' type. Due to the mitigating factors, and the fact that specific operational constraints and conditions need to be in place to successfully exploit this issue to generate an authentication bypass, we rate this security issue as moderate. Other avenues may decide on a different rating based on use case, always verify what conditions apply to your use of the library to assess risk. Many thanks to Tom Tervoort of Secura for finding and reporting this issue.

Affected and fixed versions

Package / productAffectedFixedSource
PyPI jwcrypto< 1.41.4osv

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2022-3102. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-3102.md
Affected: jwcrypto < 1.4
Fixed in: 1.4

Steps:
1. Search this machine and project for jwcrypto (PyPI): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2022-3102 being exploited?

There is no confirmed exploitation: CVE-2022-3102 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

How serious is CVE-2022-3102?

It has no CVSS score yet. Unknown.

Which versions are affected by CVE-2022-3102?

jwcrypto < 1.4.

Is there a fix for CVE-2022-3102?

Yes. Fixed in 1.4. Upgrade jwcrypto to 1.4 or later.

How do I check if I'm affected by CVE-2022-3102?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors