Where
-Infinity
0

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.

First published (updated )

When it denormalizes data into a class, the Serializer computes which attributes it may write from the #[Ignore] and #[Groups] metadata. It did that for the requested class, but wrote into another class in two cases. The first case is the class that a discriminator map picks from the data. The second is the class of the object passed with the objecttopopulate or deepobjecttopopulate option.

When the requested class has no #[Ignore] attribute and the context sets no groups, nothing was restricted. A client could then set a property that the picked class marks with #[Ignore], constructor arguments included:

#[DiscriminatorMap(typeProperty: 'kind', mapping: ['email' => EmailNotification::class])] abstract class Notification {}

class EmailNotification extends Notification { #[Ignore] public bool $skipModeration = false; }

With a #[MapRequestPayload] Notification $notification argument, the payload {"kind":"email","skipModeration":true} set skipModeration. With groups in the context, a property outside these groups could be set too. This happened when another class of the map had a property with the same name in one of the groups. The same happened with #[Ignore] when the requested class declares the map itself. On 5.4, ObjectNormalizer also returned such properties when normalizing an object whose class declares the map itself.

This affects ObjectNormalizer, PropertyNormalizer and GetSetMethodNormalizer.

The Serializer now resolves the class it writes into first, and computes the allowed attributes for that class. The type property of a discriminator map is also written only when the metadata of that class allows it.

First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203