A client can make your app treat any file on the server as if it were an upload, without uploading anything. Depending on what your app does with uploads, it could expose files like .env, move them, or reveal whether a path exists.

The Serializer built UploadedFile objects straight from request data, including the file path.

Who is affected

Apps that deserialize untrusted data with symfony/serializer (also part of symfony/symfony) into a property typed UploadedFile, or another subclass of \SplFileInfo. The Symfony advisory says this includes #[MapRequestPayload] DTOs with an UploadedFile property, which is how uploads are mapped in Symfony 8.1, with JSON or form bodies.

Assert\File doesn't stop it, because it checks the real server file. Apps that never deserialize client data into these types aren't exposed.

What to do

Update to 5.4.56, 6.4.50, 7.4.23 or 8.1.11. If you're on 8.0, update to 8.1.11. The fix (5.4, 6.4) makes DataUriNormalizer handle these types and reject anything that isn't a real file object, which #[MapRequestPayload] turns into a 422 response. A serializer you build yourself without DataUriNormalizer before the object normalizer doesn't get this protection.

The same release fixes GHSA-pxj9-jh84-vhm5, a related file read through DataUriNormalizer.

Reported by Oliver Wenzel.