Skip to main content

CVE-2026-107293: CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer in pydantic pydantic-ai

0
Low
Published: 10/08/2026 (10/08/2026, 17:16:32 UTC)
Source: CVE Database V5
Vendor/Project: pydantic
Product: pydantic-ai

Description

### Summary Pydantic AI's OpenTelemetry instrumentation supports `InstrumentationSettings(include_content=False)` to exclude message content — user prompts, model completions, tool call arguments and responses — from exported telemetry, so that agents can be monitored without sending sensitive content to the observability backend. Retry prompts — the feedback messages Pydantic AI sends back to the model when its output fails validation or an output validator raises `ModelRetry` — were not covered by this setting when they were not associated with a tool call, as with structured output modes that don't use tool calls (e.g. `NativeOutput` or `PromptedOutput`) and output validators applied to text output. Their full content was recorded on model request spans even with `include_content=False`. Since validation feedback can quote invalid values from the model's response, message content that the setting was configured to withhold could reach the telemetry backend. ### Details Retry prompts without an associated tool call were serialized into span message attributes (such as `gen_ai.input.messages` and `pydantic_ai.all_messages`) as regular text parts, and this path did not apply the `include_content` check that every other message part applies. Retry prompts tied to a tool call, and all other message content, were redacted correctly. ### Impact This does not grant an attacker any new access to the agent or its data: the content is only visible to whoever can read the exported telemetry. The exposure matters when traces are exported to a destination whose audience is broader or less trusted than the agent's own data — a third-party observability vendor or a shared backend — which is the scenario `include_content=False` exists for. The disclosed content is limited to retry feedback: validation error details, which can quote invalid values from the model's output, or output-validator `ModelRetry` messages. ### Who Is Affected You are affected if you enabled instrumentation with `include_content=False` and your agent can produce retry prompts outside of tool calls: it uses a structured output mode that doesn't rely on tool calls (such as `NativeOutput` or `PromptedOutput`), or output validators on text output. You are not affected if you don't set `include_content=False`, or if all of your agent's retries come from tool calls (including the default tool-based structured output mode), which were redacted correctly. ### Remediation Upgrade to a patched version; retry prompt content now honors `include_content=False` like all other message content. If you rely on this setting, consider reviewing previously exported traces for retry prompt content that should not have been recorded. ### Workaround for Unpatched Versions If you cannot upgrade, scrub or drop the message attributes (`gen_ai.input.messages`, `gen_ai.output.messages`, `pydantic_ai.all_messages`) in your telemetry pipeline (for example with an OpenTelemetry Collector processor), or use tool-based structured output modes, whose retry feedback honors `include_content=False`. ### Credits Reported privately by the University of Sydney Security Research Team (Liyi Zhou, Ziyue Wang, Strick, Maurice, Chenchen Yu), and later independently discovered and reported publicly, with a fix, by @sean-kim05.

CVSS v4.0

Score 2.3low

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vuln. Confidentiality
Low
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Affected software

pydantic

pydantic-ai

Affected versions
>=0.3.4 <1.107.4>=2.0.0b1 <2.27.1

pydantic

pydantic-ai-slim

Affected versions
>=0.3.4 <1.107.4>=2.0.0b1 <2.27.1
pydantic-ai
pkg:pypi/pydantic-ai
Affected versions
>=0.3.4 <1.107.4>=2.0.0b1 <2.27.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/08/2026, 17:18:22 UTC

Technical Analysis

The vulnerability involves improper removal of sensitive information before storage or transfer (CWE-212) in pydantic-ai. When OpenTelemetry instrumentation is configured with InstrumentationSettings(include_content=false), retry prompts outside tool calls in gen_ai.input.messages and pydantic_ai.all_messages can be exported, potentially exposing validation feedback and invalid model values to telemetry backend readers. This affects agents using NativeOutput, PromptedOutput, or output validators on text output. The flaw is present in versions >=0.3.4 <1.107.4 and >=2.0.0b1 <2.27.1 and has been fixed in 1.107.4 and 2.27.1.

Potential Impact

The vulnerability may lead to unintended disclosure of validation feedback and invalid model values in telemetry data, potentially exposing sensitive information to unauthorized telemetry backend readers. The CVSS 4.0 score is 2.3, indicating low severity with network attack vector, low complexity, partial attacker's privileges, and no user interaction required.

Mitigation Recommendations

Upgrade pydantic-ai to version 1.107.4 or later, or 2.27.1 or later, where this issue is fixed. Avoid using OpenTelemetry instrumentation with InstrumentationSettings(include_content=false) in affected versions until patched. Tool-call retries and deployments not using include_content=false are not affected by this issue.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-10-07T15:53:23.586Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6ac7cee62cdf04f6562b732c

Added to database: 10/08/2026, 17:12:06 UTC

Last enriched: 10/08/2026, 17:18:22 UTC

Last updated: 10/08/2026, 21:48:54 UTC

Views: 9

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses