Skip to content

fix: move isCacheKeySafe from GraphQL to AbstractItemNormalizer#7854

Open
tillmon wants to merge 1 commit intoapi-platform:4.3from
tillmon:fix/cache-key-security-all-formats
Open

fix: move isCacheKeySafe from GraphQL to AbstractItemNormalizer#7854
tillmon wants to merge 1 commit intoapi-platform:4.3from
tillmon:fix/cache-key-security-all-formats

Conversation

@tillmon
Copy link

@tillmon tillmon commented Mar 19, 2026

Q A
Branch? 4.x
Tickets -
License MIT
Doc PR -

The isCacheKeySafe() logic already exists in the GraphQL normalizer but is not applied to other formats. Move cache key safety logic to AbstractItemNormalizer to prevent attribute cache leaks across users. AbstractObjectNormalizer::$attributesCache is not user-aware, but #[ApiProperty(security: ...)] makes allowed attributes depend on the current user.

Relates to #5686

@soyuka
Copy link
Member

soyuka commented Mar 19, 2026

Isn't cache key handled differently on other formats? could you target at least 4.3 ?

@tillmon tillmon changed the base branch from main to 4.3 March 19, 2026 15:49
@tillmon tillmon force-pushed the fix/cache-key-security-all-formats branch from c6c0701 to 57e3a0f Compare March 19, 2026 16:11
@tillmon tillmon force-pushed the fix/cache-key-security-all-formats branch from 57e3a0f to e7874bb Compare March 19, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants