# GHSA-8V47-3HR7-PQM3: Property-level securityPostDenormalize is skipped when the property has #\[SerializedName\] or #\[SerializedPath\]

- Database: GitHub
- Severity: CVSS 6.5 (Medium)
- Published: 2026-11-06
- Modified: 2026-11-06

## Affected versions

- api-platform/core (Packagist): fixed in 4.4.7
- api-platform/core (Packagist): from 5.0.0, fixed in 5.0.6
- api-platform/serializer (Packagist): fixed in 4.4.7
- api-platform/serializer (Packagist): from 5.0.0, fixed in 5.0.6

## Description

### Summary

API Platform's AbstractItemNormalizer::denormalize() fails to enforce a property-level securityPostDenormalize rule when the property is exposed under another name with #[SerializedName] or #[SerializedPath]. The forbidden value is written and never reverted, so a user who is denied write access to such a property can still set it (authorization bypass, CWE-863). Affects api-platform/core 4.3.18 and the current main branch.

### Details

AbstractItemNormalizer::denormalize() reverts the writes that a property-level securityPostDenormalize denies. To find the property for each payload key, it calls the name converter WITHOUT the resource class (src/Serializer/AbstractItemNormalizer.php, around line 316 on main, 14 Oct 2026):

    $attribute = $this->nameConverter ? $this->nameConverter->denormalize((string) $attribute) : $attribute;

The default MetadataAwareNameConverter returns its argument unchanged when called without a class (denormalize() -> denormalizeFallback()). So a key declared with #[SerializedName('admin_flag')] stays "admin_flag". Then propertyMetadataFactory->create($resourceClass, 'admin_flag') throws PropertyNotFoundException (or the name misses $propertyNames), the loop continues, and the security expression is never evaluated.

Meanwhile the parent denormalize() has already WRITTEN the value, because the main denormalization loop does resolve the serialized name with the class. The two loops disagree on the property name, so the write survives the check that should revert it.

#[SerializedPath] is affected the same way: its top-level key matches no property.

Suggested fix: pass the resource class to the name converter in that loop, as the main loop does:

    $this->nameConverter->denormalize((string) $attribute, $resourceClass, $format, $context)

guarding converters that do not accept a class, as done elsewhere in the class.

### Proof of concept

1. A resource with a property exposed under a serialized name and protected by a property-level rule:

    #[ApiResource(operations: [new Get(), new Patch()])]
    class Account
    {
        #[SerializedName('admin_flag')]
        #[ApiProperty(securityPostDenormalize: "is_granted('ROLE_ADMIN')")]
        public bool $admin = false;
    }

2. As a user WITHOUT ROLE_ADMIN, send:

    PATCH /accounts/1
    Content-Type: application/merge-patch+json

    {"admin_flag": true}

3. Expected: the value is reverted (or access denied). Actual: "admin" is now true.

4. Control: sending {"admin": true} (the property name, no SerializedName) is correctly reverted, which shows the check only fails under the serialized name.

Default configuration, JSON and JSON-LD. We reproduced it in a unit test that builds a real ItemNormalizer with MetadataAwareNameConverter and a denying access checker; we can share the test file privately.

### Impact

Authorization bypass (CWE-863). Any application that pairs #[SerializedName] or #[SerializedPath] with a property-level securityPostDenormalize lets a user write a property they are not allowed to write. The severity depends on the property: a role, ownership or verification flag could lead to privilege escalation.

Not affected: applications that use no serialized name on properties protected by securityPostDenormalize.

Related, low severity (robustness, not a bypass): two pagination paths can overflow an integer and answer 500 instead of 400. The ODM partial pagination limit($offset + $limit) and the GraphQL "after" cursor in Pagination::getOffset() can become floats at PHP_INT_MAX and throw a TypeError. They could get the same guard the page path has. Happy to file these publicly if you prefer.

Found by Saad Yousfi (Namra10, https://www.namra10.com) during a security review of our own dependencies. We follow a 90-day coordinated disclosure window.

## References

- https://github.com/api-platform/core/security/advisories/GHSA-8v47-3hr7-pqm3

Page: https://cve.now/GHSA-8V47-3HR7-PQM3

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
