PyPI: jwcrypto
CVE-2026-84185
Safety vulnerability ID: SFTY-20260901-16154
Affected versions of the `jwcrypto` package are vulnerable to Improper Verification of Cryptographic Signature due to the `kid` header of the current signature being ignored when a verification key is selected from a `JWKSet`. The `JWS._verify()` method tests `'kid' in self.jose_header`, but for a General JSON Serialization JWS the `jose_header` property is a list of per-signature headers, so the check is false and every key in the set is tried. An attacker who holds a valid signing key in the application's trusted `JWKSet` can sign a token with that key while claiming another key's `kid`, and `JWS.verify()` accepts it, which defeats any tenant, subject or authorization decision the consuming application bases on `kid`.
Overview
jwcrypto – Improper Verification of Cryptographic Signature
Advisory
jwcrypto – Improper Verification of Cryptographic Signature
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
