# CVE-2026-133505: When message history is serialized and loaded again, a tool result that contains a JSON object in the serialized shape of one of Pydantic AI


- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Fix available:** No
- **Published:** 20 Nov 2026
- **Updated:** 20 Nov 2026
- **Also known as:** GHSA-4cj4-hgwf-4hc4, GHSA-jvv4-fh7q-4c38

## What is CVE-2026-133505?

CVE-2026-133505 is a medium-severity vulnerability in pydantic-ai, published on 20 Nov 2026. 

### Official description

When message history is serialized and loaded again, a tool result that contains a JSON object in the serialized shape of one of Pydantic AI's file types is rebuilt as that file. A third party who controls data a tool returns, such as a record that an MCP server or a function tool returns from an external system, can use this to make the application download a URL on its local network, or make the model provider read an s3:// object or uploaded file with the application's credentials. Applications are affected when tool results can contain third-party data, message history containing those results is serialized and loaded again (stored history, history a UI adapter holds on the server, or Temporal, DBOS or Prefect durable execution), and the model is one Pydantic AI downloads files for, one that honors force_download, or one whose provider resolves non-HTTP file URLs or uploaded files. History that a client submits through the Vercel AI or AG-UI adapter in the default mode is not affected. The issue is fixed in pydantic-ai and pydantic-ai-slim 1.107.10 and 2.66.0.

Weakness: CWE-918 (Server-Side Request Forgery), CWE-843 (Access of Resource Using Incompatible Type)

## Which versions are affected by CVE-2026-133505?


## How do I fix CVE-2026-133505?

No fix has been published for CVE-2026-133505 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-133505 being exploited?

There is no known exploitation of CVE-2026-133505 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-133505 and fix it if it is affected.

What it is: CVE-2026-133505 is a medium-severity vulnerability in pydantic-ai, published on 20 Nov 2026. 
Exploitation: There is no known exploitation of CVE-2026-133505 in the wild and no public exploit code.

Affected product: pydantic-ai. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-133505/ (Markdown: https://insights.sbomify.com/CVE-2026-133505/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-133505
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-133505
- OSV: https://osv.dev/vulnerability/CVE-2026-133505

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-133505/
Summaries are generated and may contain mistakes; the official description above is the record.
