CVE-2026-118515 — Symfony: The Serializer Builds UploadedFile Objects From Request Data, Letting a Client Point an Upload at Any Server File
One of 2 composer:symfony/serializer vulnerabilities published together by GitHub Advisory: our article covers all of them.
PHPWebVulnerabilitiesSeverity breakdown
High · 8.4
An attacker without an account can exploit this over the network, without any user action, but only under specific conditions.
- Attack from
- the network (remotely)
- Attack complexity
- low (no special conditions)
- Special conditions
- only in some setups or conditions
- Login needed
- no
- User action needed
- no
- Impact
- high on confidentiality and availability, low on integrity
- Impact on other systems
- none
Weakness
- CWE-73: External Control of File Name or Path
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| symfony/serializer (Packagist) | < 5.4.56 | 5.4.56 |
| ≥ 6.0.0, < 6.4.50 | 6.4.50 | |
| ≥ 7.0.0, < 7.4.23 | 7.4.23 | |
| ≥ 8.0.0, < 8.1.11 | 8.1.11 | |
| symfony/symfony (Packagist) | < 5.4.56 | 5.4.56 |
| ≥ 6.0.0, < 6.4.50 | 6.4.50 | |
| ≥ 7.0.0, < 7.4.23 | 7.4.23 | |
| ≥ 8.0.0, < 8.1.11 | 8.1.11 |
References by type
Vendor advisories
Patches and fixed releases
- github.com/symfony/symfony/commit/72ece5bb3084e8233325166357f85c8c0650e…
- github.com/symfony/symfony/commit/c459104eb18ebda31e112c5490970da3f30bd…
- github.com/symfony/symfony/releases/tag/v5.4.56
- github.com/symfony/symfony/releases/tag/v6.4.50
- github.com/symfony/symfony/releases/tag/v7.4.23
- github.com/symfony/symfony/releases/tag/v8.1.11
Other references
Details
Description
DataUriNormalizer builds \SplFileInfo, \SplFileObject and Symfony\Component\HttpFoundation\File\File objects from data URIs, for those exact types only. A property typed with a subclass of them, like UploadedFile, was left to ObjectNormalizer, which instantiated it through its constructor from the denormalized data, path, original name and test flag included. With #[MapRequestPayload] and a DTO holding an UploadedFile property, which is how uploads are mapped in Symfony 8.1, a request needs no upload at all to make the application handle any file of the server as one:
{"name": "x", "image": {"path": "/path/to/project/.env.local", "originalName": "a.png", "test": true}}
The same works with a form body, and with any code that deserializes untrusted data into a type holding such a property, on every maintained branch. test: true makes UploadedFile::isValid() skip is_uploaded_file() and move() fall back to rename(); code that reads the file without calling isValid() does not even need it. Depending on what the application does with the upload, this exposes any file readable by PHP, for instance when uploads are stored and served back, moves any such file when move() is called as the upload documentation shows, and reveals whether a path exists. Assert\File does not prevent it, since it validates the real server file.
Resolution
DataUriNormalizer now handles every subclass of \SplFileInfo as well: it passes through an instance of the expected type, as the files of a request are, and rejects any other data with a NotNormalizableValueException, which #[MapRequestPayload] turns into a 422. File, \SplFileInfo and \SplFileObject are still built from data URIs when the type is spelled as their ::class constant. Any other spelling of these classes, like a leading backslash, a different case or a class alias, is handled like a subclass.
A serializer built without DataUriNormalizer ahead of the object normalizer does not get this protection; the serializer configured by FrameworkBundle has it.
The patches for this issue are available here for branch 5.4 and here for branch 6.4 (and forward-ported to 7.4, 8.1 and 8.2).
Credits
Symfony would like to thank Oliver Wenzel for reporting the issue and Nicolas Grekas for providing the fix.
Symfony would also like to thank Bruno Dias and Miguel Neves from Checkmarx for their help getting a CVE assigned.
Affected
- composer:symfony/serializer
- composer:symfony/symfony
What to do
- Check whether you run an affected product or version and apply the vendor's update or mitigation.
- Follow the vendor advisory and the references below for fixed versions and workarounds.
Frequently asked questions
What is CVE-2026-118515?
DataUriNormalizer builds \SplFileInfo, \SplFileObject and Symfony\Component\HttpFoundation\File\File objects from data URIs, for those exact types only. A property typed with a subclass of them, like UploadedFile, was left to ObjectNormalizer, which instantiated it through its constructor from the denormalized data, path, original name and test flag included. Weakness type: External Control of File Name or Path (CWE-73).
How severe is CVE-2026-118515?
CVE-2026-118515 has a CVSS 4.0 base score of 8.4 (high), from the CNA. An attacker without an account can exploit this over the network, without any user action, but only under specific conditions.
Is CVE-2026-118515 being exploited?
Not as far as is known: CVE-2026-118515 is not in CISA's Known Exploited Vulnerabilities catalog as of December 1, 2026. EPSS estimates a 0.5% chance that it is exploited in the next 30 days.
Which versions are affected by CVE-2026-118515?
symfony/serializer (Packagist) < 5.4.56 (fixed in 5.4.56); symfony/serializer (Packagist) ≥ 6.0.0, < 6.4.50 (fixed in 6.4.50); symfony/serializer (Packagist) ≥ 7.0.0, < 7.4.23 (fixed in 7.4.23); symfony/serializer (Packagist) ≥ 8.0.0, < 8.1.11 (fixed in 8.1.11); and more, listed on this page.
How do I fix CVE-2026-118515?
Update to a fixed release: symfony/serializer (Packagist) 5.4.56; symfony/serializer (Packagist) 6.4.50; symfony/serializer (Packagist) 7.4.23.
Timeline & sources
References
Related vulnerabilities & news
- GHSA-5w3m-mfwg-9f8r / CVE-2026-118513 — Symfony: X509Authenticator and X509AuthenticationListener Read Escaped RFC 2253 Commas and Bare Slashes Inside a DN Value as RDN Boundaries
- GHSA-gq53-v8w2-gjhj / CVE-2026-121971 — Symfony: ScopingHttpClient Sends the Credentials of Its Default Scope to Other Origins Through Network-Path References
- miniBB 3.7.2 login open redirect lets forged POST data send users to external sites; fixed in 3.8
- Joomla! Core PHP Object Injection Vulnerability in 1.5.0-5.4.11 and 6.0.0-6.2.1
- CVE-2026-141330 — kd2org oPodSync