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`.

Created at: Dec 2, 2026Updated at: Dec 2, 2026

Overview

jwcrypto – Improper Verification of Cryptographic Signature

Advisory

jwcrypto – Improper Verification of Cryptographic Signature

Affected Package

Affecting jwcrypto package, versions>= 1.3.0, <= 1.5.9

Also affects

---

How to Fix

Upgradejwcryptoto1.6.0or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

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