CVE-2026-133761: CsvEncoder Nests Rows Once per Key Separator of a Header, Letting a Small CSV Payload Crash PHP
CsvEncoder::decode() splits each header cell on the key separator, . by default, and nests the decoded rows one level per separator, with no limit. PHP frees nested arrays recursively, so freeing data that is nested deeply enough overflows the C stack and crashes the process. With a stack of 8 MB, a CSV body of 448 KB is enough.
Each row also builds all the levels of its headers again. With a deep header, a CSV body of 2 KB made of short rows allocates more than 128 MB. A body of 1 MB keeps the CPU busy for 10 seconds or more.
Any code that decodes untrusted CSV with the Serializer is affected. From Symfony 7.4.0, this included every #[MapRequestPayload] argument that doesn't restrict acceptFormat, until 7.4.23 and 8.1.11 stopped decoding CSV payloads by default.
CSV headers can now be nested up to 512 levels, the default depth of jsondecode(). Decoding also stops when the rows go through more than 16 header levels, or create more than 4 arrays, per byte of data. A header row of up to 5 levels always fits, whatever the rows contain. Beyond these limits, decode() throws a NotEncodableValueException, which #[MapRequestPayload] turns into a 400 response.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.4.23 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 8.1.11
Event History
Frequently Asked Questions
Which applications are exposed through HTTP requests?
Any application that decodes untrusted CSV using the Serializer is affected. In Symfony 7.4.0, every #[MapRequestPayload] argument that did not restrict acceptFormat also decoded CSV by default, until Symfony 7.4.23 and 8.1.11 stopped doing so.
What must an attacker control to trigger the issue?
The attacker needs to supply CSV that is decoded by CsvEncoder::decode(), including header cells containing many key separators. The default key separator is a period, and each separator adds another nesting level.
What operational impact can a relatively small request cause?
With an 8 MB stack, a 448 KB CSV body can crash PHP through stack overflow when deeply nested arrays are freed. A 2 KB body of short rows can allocate more than 128 MB, while a 1 MB body can consume CPU for 10 seconds or more.
What happens when protected versions receive a malicious CSV payload?
CSV header nesting is limited to 512 levels, and decoding stops if rows pass through more than 16 header levels or create more than four arrays per byte of input. CsvEncoder::decode() throws NotEncodableValueException, which #[MapRequestPayload] converts to a 400 response.
Is there a configuration measure for #[MapRequestPayload] while upgrading?
Restricting acceptFormat prevents the affected default behavior in which #[MapRequestPayload] accepts CSV. The affected default applied to arguments that did not restrict acceptFormat.