Vulnérabilité dans PyJWT (CVE-2026-102266)
Résumé
Vulnérabilité dans PyJWT (CVE-2026-102266). Des informations confidentielles peuvent être exposées. Exploitable via str. Atténuation : mise à jour vers 2.14.0 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
Summary
A service that verifies HS256 tokens using an empty oct JWK through PyJWK, including a PyJWK obtained from PyJWKSet, can therefore accept attacker-generated tokens as authenticated.
PyJWT 2.13.0 rejects an empty HMAC key when it is supplied through the raw str/bytes key path, but accepts the same zero-length key when it is supplied as a symmetric PyJWK.
An oct JWK containing an empty Base64URL key value:
{"kty":"oct","k":""}
is decoded to b"". During signature verification, the PyJWK path uses this decoded value directly and does not invoke the empty-key validation in HMACAlgorithm.prepare_key. With the default enforce_minimum_key_length=False, PyJWT emits a warning and proceeds with HMAC verification using the zero-length key.
An attacker can independently calculate HMAC-SHA256(b"", signing_input) and create valid HS256 JWTs with arbitrary claims. A service that verifies HS256 tokens using an empty oct JWK through PyJWK or PyJWKSet can therefore accept attacker-generated tokens as authenticated.
The application must already contain an empty HMAC JWK, for example because a missing Base64URL configuration or secret-manager value was serialized as "k": "". The attacker does not need control of the JWK/JWKS source, a signing oracle, a private key, or a mixed algorithm allow-list.
Details
The vulnerability is caused by inconsistent validation of the same HMAC key material depending on whether it enters PyJWT as a raw…
Source: NIST National Vulnerability Database NVD GitHub Advisory
Résumé généré automatiquement
Assemblé par SecPulse à partir des données sources (CVSS, CWE, versions affectées) à l'aide de modèles, sans IA. Vérifiez la description d'origine et les références ci-dessous.
Une vulnérabilité référencée CVE-2026-102266 a été découverte dans PyJWT.
Des attaquants peuvent cibler un point d'entrée spécifique comme str à distance pour détourner le produit.
Des informations confidentielles peuvent être exposées. Score CVSS : 7.4/10.
Action : mettez à jour PyJWT vers 2.14.0 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « PyJWT CVE-2026-102266 » sur le site de l'éditeur.
CVE-2026-102266 (PyJWT) — CWE-347 / CVSS v3 7.4
Vecteur d'attaque : distant (réseau) / non authentifié / sans interaction utilisateur
Surface d'attaque : str / bytes / PyJWK / oct
Correctif : 2.14.0 — appliquer immédiatement
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.
Une vulnérabilité (CWE-347) affecte PyJWT. Les attaquants atteignent le code vulnérable via str sans authentification.
Consultez l'avis de l'éditeur pour les versions affectées de PyJWT. Surface d'attaque : str / bytes / PyJWK / oct.
Gravité : Élevée (CVSS 7.4/10). Des informations confidentielles peuvent être exposées.
Mettre à jour vers 2.14.0.
En attendant le correctif : désactivez la fonctionnalité concernée, appliquez des règles WAF, ou restreignez l'accès par ACL réseau.
Recherchez dans les logs des requêtes correspondant aux IOC connus de cette CVE. Auditez les SBOM/dépendances.
Actions de réponse
Étapes concrètes et exemples de commandes que les équipes SOC/SRE doivent exécuter dans l'ordre
-
1Identify exposure identify
grep -r 'PyJWT' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
PyJWTを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade PyJWT to 2.14.0ステージング環境で 2.14.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Paquets affectés
Références
- advisory nvd.nist.gov
- advisory github.com
- package github.com
- package pypi.org
- web github.com
- web github.com
- web github.com