Repository navigation
[security] GHSA-7xjx-hc6h-48v4: Missing authorization on FieldCollection get/layout endpoints - #2156
Draft
pimcore-deployments wants to merge 1 commit into
Conversation
…t endpoints GetController and LayoutDefinitionController lost their #[IsGranted] attribute in #1671, the same commit that introduced the FIELD_COLLECTIONS permission constant and applied it to their six sibling controllers. Re-apply the guard so both routes require the fieldcollections permission, matching TreeController and the rest of the family. Fixes GHSA-7xjx-hc6h-48v4. Co-Authored-By: Claude <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Advisory: GHSA-7xjx-hc6h-48v4
Security-Advisory: pimcore/platform-version/GHSA-7xjx-hc6h-48v4
Vulnerability and root cause
GET /pimcore-studio/api/class/field-collection/{key}(GetController) andGET /pimcore-studio/api/class/field-collection/{key}/layout(LayoutDefinitionController)were both created with an
#[IsGranted(UserPermissions::CLASS_DEFINITION->value)]guard(
78b5e6f0, #1669). One PR later (8852a482, #1671), the same commit that introduced thededicated
FIELD_COLLECTIONSpermission constant and applied it to six new sibling controllers(and migrated
TreeControllerto it) deleted the#[IsGranted]attribute from exactly these twofiles without reapplying anything. Nothing downstream — the service layer, the repository, or an
event subscriber — re-imposes the check, and the bundle has no
EventListenerdirectory at all.Result: any authenticated user (
ROLE_PIMCORE_USER) can read any field-collection definition andits layout by key, while the list/tree/create/update/delete/export/import endpoints of the same
family correctly require the
fieldcollectionspermission.Fix
Re-applied the same guard the rest of the
FieldCollectioncontroller family uses(
TreeController.php:53and six siblings), on both affected files:added directly above the existing
#[Route]attribute, with the matchinguseimports forUserPermissionsandIsGranted. This is a one-line, additive guard per file — no other behaviorchanges.
Backward compatibility
Both
GetControllerandLayoutDefinitionControllerare marked@internal, so they are outsidethe BC promise per
pimcore-backward-compatibility. Independent of that: the change onlyrestores authorization that existed on both routes from the day they were introduced and that
every sibling endpoint in the same family already enforces today. A legitimate caller already has
the
fieldcollectionspermission (required to reach the list/tree/CRUD endpoints of the sameresource), so no intended workflow is broken — only the gap that let a caller without that
permission bypass it is closed.
Testing
Added
tests/Unit/Class/Controller/FieldCollection/FieldCollectionControllerPermissionTest.php, areflection-based regression test that asserts both controllers' route-bearing method carries an
#[IsGranted]attribute with theFIELD_COLLECTIONSpermission value, following the existingprecedent
tests/Unit/Class/Controller/CustomLayout/CustomLayoutControllerPermissionTest.php(written for a prior, analogous advisory). Against the vulnerable code this test fails
(
assertNotEmptyon an empty attributes array); against the fix it passes, and it does not rely onbooting the kernel or a real request, so it exercises exactly the regressed condition
(the missing attribute) without needing a running instance.
Tests added:
tests/Unit/Class/Controller/FieldCollection/FieldCollectionControllerPermissionTest.phpVerification performed:
php -lon both changed controllers and the new test file (no syntaxerrors). The bundle has no local
vendor/in this sandbox (no Composer/network access), so theCodeception suite itself was not run locally — CI is the source of truth for that.
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
api.anthropic.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.