CVE-2026-118515: Symfony The Serializer Builds UploadedFile Objects Vulnerability

HIGH
Advisory Identifier: GHSA-h38r-xrmh-cwhr
CWE-73
Published
Advisory Summary

CVE-2026-118515 is a HIGH the serializer builds uploadedfile objects vulnerability (CWE-73: External Control of File Name or Path) affecting Symfony libraries in the Packagist ecosystem. The issue involves the serializer builds uploadedfile objects from request data, letting a client point an upload at any server file. Remediation is available by upgrading affected packages to version 5.4.56, 6.4.50, 7.4.23, 8.1.11.

CVE-2026-118515 at a Glance

CVE Identifier CVE-2026-118515
GHSA Identifier GHSA-h38r-xrmh-cwhr
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-73: External Control of File Name or Path
Affected Product Symfony
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-118515

To remediate this vulnerability, upgrade all affected Symfony dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

symfony/serializer fixed: 5.4.56
Upgrade symfony/serializer to 5.4.56
symfony/serializer fixed: 6.4.50
Upgrade symfony/serializer to 6.4.50
symfony/serializer fixed: 7.4.23
Upgrade symfony/serializer to 7.4.23
symfony/serializer fixed: 8.1.11
Upgrade symfony/serializer to 8.1.11
symfony/symfony fixed: 5.4.56
Upgrade symfony/symfony to 5.4.56
symfony/symfony fixed: 6.4.50
Upgrade symfony/symfony to 6.4.50
symfony/symfony fixed: 7.4.23
Upgrade symfony/symfony to 7.4.23
symfony/symfony fixed: 8.1.11
Upgrade symfony/symfony to 8.1.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for symfony/serializer

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-118515, inspect your project dependencies for Symfony:

inspect dependencies for symfony/serializer

Analyze the terminal output to locate any version of Symfony in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.4.56), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In Symfony, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```json {"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](https://github.com/symfony/symfony/commit/72ece5bb3084e8233325166357f85c8c0650ee86) for branch 5.4 and [here](https://github.com/symfony/symfony/commit/c459104eb18ebda31e112c5490970da3f30bd668) 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](https://github.com/cx-bruno-dias) and [Miguel Neves](https://github.com/cx-miguel-neves) from Checkmarx for their help getting a CVE assigned.

CVE-2026-118515 Affected Symfony Versions

8 component(s)
Fixed Versions:
5.4.566.4.507.4.238.1.11
Product / Package Ecosystem Affected Versions Fixed Version
symfony/serializer
Packagist
< 5.4.56
5.4.56
symfony/serializer
Packagist
≥ 6.0.0
< 6.4.50
6.4.50
symfony/serializer
Packagist
≥ 7.0.0
< 7.4.23
7.4.23
symfony/serializer
Packagist
≥ 8.0.0
< 8.1.11
8.1.11
symfony/symfony
Packagist
< 5.4.56
5.4.56
symfony/symfony
Packagist
≥ 6.0.0
< 6.4.50
6.4.50
symfony/symfony
Packagist
≥ 7.0.0
< 7.4.23
7.4.23
symfony/symfony
Packagist
≥ 8.0.0
< 8.1.11
8.1.11

References

Frequently Asked Questions

What is CVE-2026-118515?
CVE-2026-118515 is a security vulnerability in Symfony involving The Serializer Builds UploadedFile Objects From Request Data, Letting a Client Point an Upload at Any Server File under CWE-73: External Control of File Name or Path.
Which Symfony versions are affected?
Affected versions include releases prior to 5.4.56, 6.4.50, 7.4.23, 8.1.11 across affected packages: symfony/serializer, symfony/symfony.
What version fixes CVE-2026-118515?
Upgrading to 5.4.56, 6.4.50, 7.4.23, 8.1.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/serializer affected?
Yes, symfony/serializer is affected in releases prior to 5.4.56, 6.4.50, 7.4.23, 8.1.11. Upgrade your dependency to 5.4.56, 6.4.50, 7.4.23, 8.1.11 or later.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 5.4.56, 6.4.50, 7.4.23, 8.1.11. Upgrade your dependency to 5.4.56, 6.4.50, 7.4.23, 8.1.11 or later.
What CWE is associated with CVE-2026-118515?
CVE-2026-118515 is classified under CWE-73: External Control of File Name or Path (The product allows user input to control or influence paths or file names that are used in filesystem operations.).
How can I check Packagist dependencies for CVE-2026-118515?
Run the dependency tree command: 'inspect dependencies for symfony/serializer'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h38r-xrmh-cwhr",
  "modified" : "2026-12-01T21:17:24Z",
  "published" : "2026-12-01T21:17:23Z",
  "aliases" : [ "CVE-2026-118515" ],
  "summary" : "Symfony: The Serializer Builds UploadedFile Objects From Request Data, Letting a Client Point an Upload at Any Server File",
  "details" : "### Description\n\n`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:\n\n```json\n{\"name\": \"x\", \"image\": {\"path\": \"/path/to/project/.env.local\", \"originalName\": \"a.png\", \"test\": true}}\n```\n\nThe 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.\n\n### Resolution\n\n`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.\n\nA serializer built without `DataUriNormalizer` ahead of the object normalizer does not get this protection; the serializer configured by FrameworkBundle has it.\n\nThe patches for this issue are available [here](https://github.com/symfony/symfony/commit/72ece5bb3084e8233325166357f85c8c0650ee86) for branch 5.4 and [here](https://github.com/symfony/symfony/commit/c459104eb18ebda31e112c5490970da3f30bd668) for branch 6.4 (and forward-ported to 7.4, 8.1 and 8.2).\n\n### Credits\n\nSymfony would like to thank Oliver Wenzel for reporting the issue and Nicolas Grekas for providing the fix.\n\nSymfony would also like to thank [Bruno Dias](https://github.com/cx-bruno-dias) and [Miguel Neves](https://github.com/cx-miguel-neves) from Checkmarx for their help getting a CVE assigned.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/serializer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.56"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/serializer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.4.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/serializer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.4.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/serializer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.1.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.56"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.4.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.4.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.1.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-h38r-xrmh-cwhr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-118515"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/72ece5bb3084e8233325166357f85c8c0650ee86"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/c459104eb18ebda31e112c5490970da3f30bd668"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/serializer/CVE-2026-118515.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-118515.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/releases/tag/v5.4.56"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/releases/tag/v6.4.50"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/releases/tag/v7.4.23"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/releases/tag/v8.1.11"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2026-118515"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-73" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-01T21:17:23Z",
    "nvd_published_at" : "2026-11-06T17:17:16Z"
  }
}