Vulnérabilité dans PyJWT (CVE-2026-102273)
Résumé
Vulnérabilité dans PyJWT (CVE-2026-102273). Des informations confidentielles peuvent être exposées. Exploitable via kty. 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
PyJWT 2.13.0 contains an incomplete defense against algorithm confusion when
an application mixes symmetric and asymmetric algorithms in one verification
path. A public RSA, EC, or OKP JWK can be accepted as an HMAC secret when it
is wrapped in a JWKS object, nested in an array, or represented in another
container form that does not expose a top-level kty member.
Impact
An attacker who knows the public key material can forge HS256/HS384/HS512
tokens if the application simultaneously:
- allows both HS* and asymmetric algorithms;
- passes raw public JWK/JWKS JSON as
key=; and - uses that same value as the HMAC secret.
This can allow forged JWT claims in affected application configurations. The
issue does not affect applications that keep symmetric and asymmetric
verification paths separate and follow PyJWT's algorithm-selection guidance.
Fix status
The fix is on master in commit 801cd12 (fix: reject public JWK container HMAC keys). HMACAlgorithm.prepare_key now rejects public JWK members found in
objects, arrays, nested containers, BOM/UTF variants, and recursion-limit
inputs. It also recognizes escaped JSON member names without treating ordinary
string values as JWKs. Ordinary JSON secrets remain accepted byte-for-byte.
The change was tested with focused regression tests and the full local tox
matrix. Available Python 3.9, 3.12, and 3.13 crypto/no-crypto suites, mypy,
package metadata, and coverage passed; unavailable interpreters were s…
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-102273 a été découverte dans PyJWT.
Des attaquants peuvent cibler un point d'entrée spécifique comme kty à 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-102273 » sur le site de l'éditeur.
CVE-2026-102273 (PyJWT) — CWE-347 / CVSS v3 7.4
Vecteur d'attaque : distant (réseau) / non authentifié / sans interaction utilisateur
Surface d'attaque : kty / master / HMACAlgorithm.prepare_key
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 kty sans authentification.
Consultez l'avis de l'éditeur pour les versions affectées de PyJWT. Surface d'attaque : kty / master / HMACAlgorithm.prepare_key.
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