# GHSA-CWHH-732Q-P35C: Policy-protected properties leak across users via the attribute cache

- Database: GitHub
- Severity: CVSS 3.1 (Low)
- 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

`AbstractItemNormalizer::isCacheKeySafe()` decides whether a resource's allowed-property list can be cached and reused, but it checks only `getSecurity()` and never `getPolicy()`. A property guarded solely by `#[ApiProperty(policy: ...)]` is still access-checked per object by `canAccessAttribute()` (which reads `getSecurity() ?? getPolicy()`), yet its class is treated as cache-safe, so the first object's decision is cached and reused for later objects and later requests. A user can then read another user's policy-protected field. `isCacheKeySafe()` was added to fix GHSA-pjhx-3c3w-9v23 for `security`, and never covered `policy`.

## Proof of concept

Reproduced on `api-platform/core` 5.0.3 from Packagist, through the published `ApiPlatform\Hal\Serializer\ItemNormalizer`. A resource has a property guarded only by `policy` whose checker grants it to the owner alone. The owner serializes their own item and the property is included. A second viewer who owns nothing then serializes the same item through the same normalizer instance (a long-running worker: Octane, RoadRunner, Swoole, or a persistent Symfony kernel), and gets the owner's value back.

```
owner   /accounts/1  -> {"id":1,"name":"Alice","ssn":"SSN-111-ALICE"}   (owner, allowed)
viewer  /accounts/1  -> {"id":1,"name":"Alice","ssn":"SSN-111-ALICE"}   (not owner, leaked)
```

The checker is consulted once for `/accounts/1`, not twice. Switch the property from `policy` to `security` and `isCacheKeySafe()` returns false, the cache is skipped, and the second viewer correctly gets no `ssn`. Same object-dependent check, enforced identically, gated differently.

## Impact

A viewer reads a property their own policy forbids, because an earlier request cached an authorized viewer's decision for that resource class. In the Laravel bridge `policy` is the only way to guard a property, so any Laravel app doing so on a long-running worker is affected under default config. The fix is to have `isCacheKeySafe()` also return false when `getPolicy()` is set.

## References

- https://github.com/api-platform/core/security/advisories/GHSA-cwhh-732q-p35c

Page: https://cve.now/GHSA-CWHH-732Q-P35C

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