CSRF dans pydantic-ai (CVE-2026-107295)
Résumé
Vulnérabilité dans pydantic-ai (CVE-2026-107295). Les données peuvent être altérées par des attaquants. Atténuation : mise à jour vers 2.28.0 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
Summary
The Pydantic AI development web chat UI (Agent.to_web(), clai web) did not check the content type of requests to its chat endpoint. This allowed a website visited by a developer to submit a request to a chat UI running on that developer's machine, causing the served agent to run and to execute its tools with the privileges and credentials of the local process.
Binding the web UI to localhost — the default — does not prevent this, because a page open in the developer's browser can reach the loopback address.
Impact
Applications and developers serving an agent through Agent.to_web() or clai web. The consequences depend on the tools the served agent exposes, and can include data disclosure as well as unwanted tool side effects. Tools marked requires_approval=True were not protected either, because the endpoint trusts approval decisions relayed by the client.
Mitigation
Upgrade to a patched version. The chat endpoint now requires Content-Type: application/json and rejects other requests before the request body is parsed and before the agent runs. The bundled chat UI already sends this header; scripts and other non-browser clients that call the endpoint directly may need to be updated to send it.
If you cannot upgrade, don't run the web UI while browsing untrusted sites, stop it when you aren't using it, and don't serve an agent with side-effecting tools through it.
Credits
- Thai Son Dinh from VinSOC Labs (R&D)
Source: GitHub Security Advisories (Global) 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-107295 a été découverte dans pydantic-ai.
Les données peuvent être altérées par des attaquants. Score CVSS : 7.6/10.
Action : mettez à jour pydantic-ai vers 2.28.0 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « pydantic-ai CVE-2026-107295 » sur le site de l'éditeur.
CVE-2026-107295 (pydantic-ai) — CWE-352 / CVSS v3 7.6
Vecteur d'attaque : distant (réseau) / non authentifié
Correctif : 2.28.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 CSRF (CWE-352) affecte pydantic-ai.
Consultez l'avis de l'éditeur pour les versions affectées de pydantic-ai.
Gravité : Élevée (CVSS 7.6/10). Les données peuvent être altérées par des attaquants.
Mettre à jour vers 2.28.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 'pydantic-ai' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
pydantic-aiを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade pydantic-ai to 2.28.0ステージング環境で 2.28.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。