GHSA-f97c-ph8j-8vff: Input Validation

Published Aug 28, 2026
·
Updated

Summary The Studio API class definition creation endpoint in pimcore/studio-backend-bundle is guarded by the objects permission instead of the classes permission, allowing any standard editor-level user to create class definitions without admin privileges. Class definition creation is a structural admin operation that generates new database tables and PHP class files on the server. Additionally, the API layer performs no format validation on the uid field before passing it to the model layer, relying solely on model-level validation that exists downstream in ClassDefinition::saveClassInternal().

Details

Issue 1 — Incorrect permission guard on CreateController

studio-backend-bundle/src/Class/Controller/DefinitionConfiguration/CreateController.php:

php #[IsGranted(UserPermissions::DATAOBJECTS->value)]

The endpoint POST /pimcore-studio/api/class/definition/configuration-view/detail/create is protected by DATAOBJECTS (the objects permission), which is a standard editor-level permission granted to content editors for creating and editing data objects. Class definition creation is a structural admin operation equivalent to schema modification, it creates new database tables and generates PHP class files on the server. This operation should require the classes permission, which is the permission Pimcore enforces for class definition management in the Classic Admin.

Any authenticated user with object editing rights can call this endpoint and create new class definitions, bypassing the intended admin-only restriction. The same user cannot perform this action through the Classic Admin UI, confirming the Studio API enforces a weaker permission check than the existing interface.

Correct guard: php #[IsGranted(UserPermissions::CLASSES->value)]

Issue 2 — No UID format validation at the API layer

studio-backend-bundle/src/Class/MappedParameter/CreateClassDefinitionParameters.php:

php public function construct( private string $name, private string $uid ) { if (trim($name) === '' || trim($uid) === '') { throw new InvalidArgumentException('Class name and UID cannot be empty.'); } }

Only an empty-string check is performed on uid at the API boundary before the value is passed to the model layer. While ClassDefinition::saveClassInternal() now validates the UID format via anchored regex, no equivalent validation exists in CreateClassDefinitionParameters. A malformed UID passes through the API layer without any format check and only fails deep in the model layer, returning an unformatted internal exception to the caller rather than a clean 400 API validation response, which can expose internal stack traces depending on server configuration.

Defense-in-depth requires validation at the API boundary consistent with the model layer. The same regex now applied in ClassDefinition.php should also be enforced here:

php if (!pregmatch('/^[a-zA-Z0-9][a-zA-Z0-9]$/', trim($this->uid))) { throw new InvalidArgumentException( sprintf('Invalid UID for class definition: %s', $this->uid) ); }

Affected files in pimcore/studio-backend-bundle: - src/Class/Controller/DefinitionConfiguration/CreateController.php - src/Class/MappedParameter/CreateClassDefinitionParameters.php

Vulnerable endpoint: POST /pimcore-studio/api/class/definition/configuration-view/detail/create

PoC

Prerequisites: - Pimcore 2026.1.x with Studio API enabled - A user editor with only the objects permission and no classes permission

Step 1 — Authenticate as the editor user:

bash curl -s -c /tmp/cookies.txt -X POST \ "https://your-pimcore/pimcore-studio/api/login" \ -H "Content-Type: application/json" \ -d '{"username":"editor","password":"password"}'

Expected response: json {"message": "Login successful"}

Step 2 — Confirm the user has no class management access in Classic Admin

Log into Classic Admin as editor. Verify the Classes menu is not visible and the user cannot access Settings > Classes. This confirms the classes permission is not granted to this user.

Step 3 — Create a class definition via the Studio API despite lacking the classes permission:

bash curl -s -b /tmp/cookies.txt -X POST \ "https://your-pimcore/pimcore-studio/api/class/definition/configuration-view/detail/create" \ -H "Content-Type: application/json" \ -d '{"name":"UnauthorizedClass","uid":"testuid1"}'

Expected response (vulnerable): json {"id": "testuid1", "name": "UnauthorizedClass", ...}

The class definition is created successfully by a user with no classes permission. The Studio API accepts the request where the Classic Admin would deny it entirely.

Expected response (patched): json {"status": 403, "detail": "Access denied."}

Impact Any authenticated Pimcore user with the standard objects permission can create class definitions via the Studio API, bypassing the classes permission restriction enforced in the Classic Admin. This is a privilege escalation from editor level to a capability that should be restricted to administrators. Class definition creation generates new database tables and PHP class files on the server, giving an unprivileged user the ability to modify the application schema, introduce malformed class structures, and trigger downstream processing outside their permission scope.

The missing API-layer UID validation compounds this by allowing malformed UIDs to reach the model layer, producing unhandled internal exceptions that may expose stack traces depending on server debug configuration.

- Authentication required from attacker: Yes - valid Pimcore session with objects permission required - Authentication required from victim: No - no victim action needed - What is accessible: Full class definition creation capability including database table generation and PHP class file creation on the server

Affected Software

2 affected componentsFixes available
composer/pimcore/studio-backend-bundle>=2026.1.0<2026.1.6
2026.1.6
composer/pimcore/studio-backend-bundle<2025.4.6
2026.1.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/pimcore/studio-backend-bundle to a version that resolves this vulnerability.

    Fixed in 2026.1.6
  2. Configuration

    Change the endpoint guard from `#[IsGranted(UserPermissions::DATA_OBJECTS->value)]` (objects permission) to `#[IsGranted(UserPermissions::CLASSES->value)]` so editor-level users with only `objects` cannot create class definitions.

    pimcore studio-backend-bundle (Studio API) Permission guard for `POST /pimcore-studio/api/class/definition/configuration-view/detail/create` = Require `classes` permission (not `DATA_OBJECTS`/`objects`)
  3. Configuration

    Add/ensure API boundary validation for `uid` in `CreateClassDefinitionParameters` before passing to `ClassDefinition::saveClassInternal()`. Enforce anchored format check (not only empty-string check), and reject invalid UIDs with an API validation error (e.g., 400) instead of allowing internal exceptions.

    pimcore studio-backend-bundle (CreateClassDefinitionParameters) API-layer UID validation for `uid` = Use regex `/^[a-zA-Z0-9][a-zA-Z0-9_]*$/` on `trim($uid)` (and reject empty `uid`)

Event History

Aug 28, 2026
Advisory Published
via GitHub·07:05 PM
Data Sourced
via GitHub·07:05 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which users are exposed to this issue?

Any authenticated user granted the standard editor-level objects permission can reach the affected class-definition creation endpoint. Administrator privileges or the classes permission are not required.

2

What access does an attacker need to exploit it?

The attacker needs a valid account with the objects permission and network access to the Studio API. No user interaction is required.

3

What is the practical impact of successful exploitation?

An affected user can create class definitions, a structural administrative action that generates database tables and PHP class files on the server. The endpoint also passes the uid field to the model layer without API-level format validation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203