GHSA-pxj9-jh84-vhm5: Symfony: DataUriNormalizer Opens Data URIs With a Non-Lowercase Scheme as Local Files, Letting a Client Read Any Server File
The Symfony Serializer component DataUriNormalizer::denormalize() matches the data: scheme with a case-sensitive regular expression, allowing a value with an uppercase scheme, such as DATA:,/../../../etc/passwd, to bypass it, resulting in Arbitrary Local File Read through Path Traversal in Symfony versions prior to 5.4.56, 6.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11.
A value whose scheme is not lowercase data: are treated as a local file path and opened instead of being decoded as inline data, so the resulting File, \SplFileInfo, or \SplFileObject points at a file on the server, which the application then handles as the uploaded content.
Any endpoint that deserializes untrusted input into one of these types is affected. FrameworkBundle registers DataUriNormalizer ahead of ObjectNormalizer by default. A single request with a crafted DATA: value is enough to read arbitrary local files that the application can access, with no authentication needed if the endpoint is public.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Symfonyto a version that resolves this vulnerability.Fixed in 5.4.56 - Upgrade
Upgrade
Symfonyto a version that resolves this vulnerability.Fixed in 6.4.50 - Upgrade
Upgrade
Symfonyto a version that resolves this vulnerability.Fixed in 7.4.23 - Upgrade
Upgrade
Symfonyto a version that resolves this vulnerability.Fixed in 8.1.11
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications are affected if an endpoint deserializes untrusted input into a File, SplFileInfo, or SplFileObject. FrameworkBundle registers DataUriNormalizer ahead of ObjectNormalizer by default, so applications using that default normalizer ordering can be exposed.
What does an attacker need to exploit it?
An attacker needs to submit a crafted value using a non-lowercase data scheme, such as a DATA: value containing path traversal, to a vulnerable deserialization endpoint. A single request is sufficient, and authentication is not required when the endpoint is public.
What is the impact if exploitation succeeds?
The crafted value is treated as a local file path rather than inline data, causing the resulting file object to point to a server-side file. The application may then handle that file as uploaded content, allowing reads of files accessible to the application process.
How can I determine whether an endpoint is affected?
Review endpoints that accept untrusted serialized input and determine whether they denormalize values into File, SplFileInfo, or SplFileObject. Also check whether the application uses a Symfony release earlier than 5.4.56, 6.4.50, 7.4.23, or 8.1.11.