Pydantic AI fixes file type confusion caused by history reload, fixed in 1.107.10 and 2.66.0
Pydantic AI fixed a file type confusion vulnerability when message history is reloaded: when serialized history is reloaded, JSON data returned by a tool that has the same serialized structure as ImageUrl, DocumentUrl, AudioUrl, VideoUrl, or UploadedFile is reconstructed as a file. A third party that controls tool-returned content does not need to inject instructions; it only needs to wait for the next model request to make the application, when force_download is allow-local, disable private-network blocking and download an intranet URL, or make the model provider use application credentials to read non-HTTP objects such as s3://. Affected versions are 1.50.0 to 1.107.9 and 2.0.0b1 to 2.65.0, fixed in 1.107.10 and 2.66.0. After the fix, tool results record the file items they contain outside the tool data during serialization; history saved by older versions only reconstructs file-like mappings as HTTP(S) URLs with force_download reset.
The advisory limits the trigger conditions to tool results that can be influenced by third parties and whose history will be reloaded, which teams deploying Pydantic AI Agents can use to determine whether they fall within the affected scope.