🇰🇷 한글 설명
Pydantic AI 프레임워크의 UI 어댑터에서 메시지 정제 과정 중 인덱스 계산 오류가 발생하여, 검증되지 않은 클라이언트의 도구 호출이 에이전트에게 전달될 수 있는 취약점입니다. 공격자는 이를 통해 모델이 생성하지 않은 임의의 인자를 사용하여 서버 도구를 실행할 수 있습니다. 이 문제는 1.107.1 및 2.5.0 버전에서 수정되었습니다.
💡 쉬운 설명
AI가 명령을 내리지 않았는데도 사용자가 가짜 명령을 끼워 넣어 AI의 도구를 마음대로 조작할 수 있는 보안 결함입니다. 공격자가 조작된 메시지를 보내면 AI가 검증 없이 특정 기능을 실행하게 만들 수 있습니다.
🇺🇸 원문 (English)
Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. In versions 1.88.0 up to but not including 1.107.1 and 2.0.0b1 up to but not including 2.5.0, the UI adapters (AG-UI via Agent.to_ag_ui()/AGUIAdapter, and Vercel AI via VercelAIAdapter) use sanitize_messages to strip unresolved ("dangling") client-submitted tool calls from untrusted message history before it reaches the agent, a defense-in-depth default that prevents the agent from executing tool calls the model never emitted. However, the strip anchored to a message index computed before sanitization ran, so when a trailing client message sanitized to empty and was dropped (for example a client system message under the default manage_system_prompt='server'), a preceding assistant response carrying an unresolved tool call became the new tail and was dispatched without inspection. As a result, a remote client could cause a registered, non-approval server tool to run with client-supplied arguments rather than arguments the model produced. The impact is bounded by what the affected tools do and is most significant for applications that gate tool execution in a model-request hook (before_model_request / after_model_request), since a forged call skips the model turn and bypasses that guardrail; approval-gated tools (requires_approval=True) are not auto-executed by this path. This issue has been fixed in versions 1.107.1 and 2.5.0.
📍 영향받는 시스템
Pydantic AI versions 1.88.0 <= v < 1.107.1 and 2.0.0b1 <= v < 2.5.0
⚔️ 공격 벡터
정제되지 않은 클라이언트 메시지를 통해 모델의 검증을 우회하는 가짜 도구 호출(Tool Call)을 주입
🛡️ 대응 방법
Pydantic AI를 최신 버전인 1.107.1 또는 2.5.0 이상으로 업데이트
🔧 검증 코드
출력된 버전이 1.107.1 미만이거나 2.5.0 미만(2.0.0b1 이상 버전 기준)이면 취약한 상태입니다.
pip show pydantic-ai | grep Version