cvelo
P3 · MediumCVSS 6.3EPSS 0.9%

The Serializer Doesn't Enforce #[Ignore] on the Class Picked by a Discriminator Map or object_to_populate

  • CVE-2026-133752
  • EUVD-2026-135241

Description

Show the whole description

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 object_to_populate or deep_object_to_populate 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.

Text from the CVE.org record.

Recommendation

  • Symfony symfony/serializer

    • If you run a version from 8.0.0 to before 8.1.12update to 8.1.12 or laterMinor version change: check the release notes
    • If you run a version from 7.0.0 to before 7.4.24update to 7.4.24 or laterMinor version change: check the release notes
    • If you run a version from 6.0.0 to before 6.4.51update to 6.4.51 or laterMinor version change: check the release notes
    • If you run a version from 5.1.0 to before 5.4.57update to 5.4.57 or laterMinor version change: check the release notes
  • Symfony symfony/symfony

    • If you run a version from 8.0.0 to before 8.1.12update to 8.1.12 or laterMinor version change: check the release notes
    • If you run a version from 7.0.0 to before 7.4.24update to 7.4.24 or laterMinor version change: check the release notes
    • If you run a version from 6.0.0 to before 6.4.51update to 6.4.51 or laterMinor version change: check the release notes
    • If you run a version from 5.1.0 to before 5.4.57update to 5.4.57 or laterMinor version change: check the release notes

Taken from the version ranges of the CVE.org record. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.

Affected

  • Symfony symfony/serializer

    Affected versionsFixed in
    from 8.0.0 to before 8.1.128.1.12
    from 7.0.0 to before 7.4.247.4.24
    from 6.0.0 to before 6.4.516.4.51
    from 5.1.0 to before 5.4.575.4.57
  • Symfony symfony/symfony

    Affected versionsFixed in
    from 8.0.0 to before 8.1.128.1.12
    from 7.0.0 to before 7.4.247.4.24
    from 6.0.0 to before 6.4.516.4.51
    from 5.1.0 to before 5.4.575.4.57

Product versions from the CVE.org record.

Timeline

  1. Published

Related news

No article from the followed outlets names this vulnerability.