Description
An authenticated administrative user who can import or save DataObject class definitions can inject attacker-controlled composite index metadata and trigger unintended SQL execution in the backend.
The vulnerable flow accepts compositeIndices from imported JSON, stores the values without strict validation, and later concatenates them directly into ALTER TABLE ... DROP INDEX and ALTER TABLE ... ADD INDEX statements executed through Doctrine DBAL.
Although the original report focused on compositeIndices.index_key, independent code review shows that the strongest and most reliable injection point is compositeIndices.index_columns, because it is inserted verbatim inside the ADD INDEX (...) clause. This permits injection of additional ALTER TABLE subclauses against Pimcore object tables without relying on stacked queries.
Vulnerability
Root cause
- Source:
Pimcore\Model\DataObject\ClassDefinition\Service::importClassDefinitionFromJson() accepts compositeIndices directly from imported JSON.
- Assignment:
Pimcore\Model\DataObject\ClassDefinition::setCompositeIndices() does not enforce an allowlist for index names or column names.
- The only special handling is a ManyToOne relation rewrite to
__id and __type, which is not a security control.
- Sink:
Pimcore\Model\DataObject\Traits\CompositeIndexTrait::updateCompositeIndices() builds raw SQL with string concatenation and executes it via $this->db->executeQuery(...).
- Missing protection:
quoteIdentifier() is used for the SHOW INDEXES query, but not for the dynamic ALTER TABLE statements.
- No server-side schema validation restricts
index_key or index_columns to known safe identifier characters.
Confirmed source-to-sink path
importClassDefinitionFromJson() decodes attacker-controlled JSON and forwards compositeIndices.
setCompositeIndices() stores those values without sanitizing identifier content.
ClassDefinition::save() reaches ClassDefinition\Dao::update().
Dao::update() calls updateCompositeIndices() for:
object_store_<classId>
object_query_<classId>
Localizedfield\Dao also calls updateCompositeIndices() for:
- localized query tables
- localized store tables
Why this is exploitable
The vulnerable ADD INDEX statement is built as:
'ALTER TABLE `'.$table.'` ADD INDEX `' . $key.'` ('.$columnName.');'
$columnName is produced from implode(',', $columns) and is not quoted or validated. A malicious index_columns element such as:
slider), DROP COLUMN `oo_className` --
produces SQL of the form:
ALTER TABLE `object_query_<id>` ADD INDEX `c_poc_idx` (slider), DROP COLUMN `oo_className` -- );
This remains a single ALTER TABLE statement, so the base vulnerability does not depend on multi-statement support. The attacker can inject additional DDL clauses affecting the target Pimcore object table.
Impact
The issue allows a privileged attacker to alter backend SQL behavior during class-definition import/save and modify schema on Pimcore object tables associated with the affected class.
Practical impact includes:
- unauthorized schema modification on object query/store tables
- backend denial of service by breaking expected table layout
- data integrity impact for DataObject storage and queries
index_key is also concatenated into SQL without proper identifier escaping, but the most defensible exploitation path is through index_columns.
Relevant code:
models/DataObject/ClassDefinition/Service.php:92-137
models/DataObject/ClassDefinition.php:994-1006
models/DataObject/Traits/CompositeIndexTrait.php:30-85
models/DataObject/ClassDefinition/Dao.php:217-218
models/DataObject/Localizedfield/Dao.php:945-951
PoC
Application-level PoC
Preconditions:
- valid authenticated administrative session
- ability to import or save a class definition containing
compositeIndices
The original report reproduced the issue through an authenticated Studio endpoint:
POST /pimcore-studio/api/class/definition/configuration-view/detail/1/import
Minimal malicious JSON fragment:
{
"compositeIndices": [
{
"index_key": "poc_idx",
"index_type": "query",
"index_columns": [
"slider), DROP COLUMN `oo_className` -- "
]
}
]
}
Reproduction:
- Authenticate as an administrator with permission to manage/import class definitions.
- Export an existing class definition or prepare a valid class-definition JSON document.
- Replace only the
compositeIndices section with the payload above.
- Import the modified definition or save the class through the administrative workflow.
Expected result:
- Pimcore reaches
updateCompositeIndices() during class save/import.
- The backend executes an attacker-influenced
ALTER TABLE statement against the target object table.
- The affected class table is modified unexpectedly, for example by dropping a column or otherwise changing schema.
Minimal source-level confirmation
The behavior is directly visible from the code path:
$newIndicesMap['c_' . $key] = implode(',', $columns);
$columnName = $newIndicesMap[$key];
$this->db->executeQuery(
'ALTER TABLE `'.$table.'` ADD INDEX `' . $key.'` ('.$columnName.');'
);
No escaping or allowlist validation is applied to $columns before they are interpolated into SQL.
Evidence of Exploitation
https://github.com/user-attachments/assets/64a49147-12a5-4550-ba22-cb4383523557

System Information
Pimcore Platform
Version v12.3.3
Database layer: doctrine/dbal ^4.4
Operating System: Any
Resources
Github Repository: https://github.com/pimcore/pimcore
Security: https://github.com/pimcore/pimcore/security
This issue was discovered by Oscar Uribe, Security Researcher at Fluid Attacks, who reached out to Pimcore.
As part of standard disclosure measures, Fluid Attacks follows a timeline (outlined at https://fluidattacks.com/advisories/policy) that is aligned with ISO/IEC 29147:2018 and ISO/IEC 30111:2019. In short, the timeline works as follows: Fluid Attacks requests acknowledgment of the report within a few days of project maintainers first accessing it, and from there, Fluid Attacks is glad to coordinate a joint disclosure date with the affected party, typically within 90 days of the initial discovery. This allows the maintainers' team reasonable time to assess, develop, and release a fix.
The CVE ID "CVE-2026-5394" has been reserved for this issue, and the advisory will eventually be published at https://fluidattacks.com/advisories/dragons.
References
Description
An authenticated administrative user who can import or save DataObject class definitions can inject attacker-controlled composite index metadata and trigger unintended SQL execution in the backend.
The vulnerable flow accepts
compositeIndicesfrom imported JSON, stores the values without strict validation, and later concatenates them directly intoALTER TABLE ... DROP INDEXandALTER TABLE ... ADD INDEXstatements executed through Doctrine DBAL.Although the original report focused on
compositeIndices.index_key, independent code review shows that the strongest and most reliable injection point iscompositeIndices.index_columns, because it is inserted verbatim inside theADD INDEX (...)clause. This permits injection of additionalALTER TABLEsubclauses against Pimcore object tables without relying on stacked queries.Vulnerability
Root cause
Pimcore\Model\DataObject\ClassDefinition\Service::importClassDefinitionFromJson()acceptscompositeIndicesdirectly from imported JSON.Pimcore\Model\DataObject\ClassDefinition::setCompositeIndices()does not enforce an allowlist for index names or column names.__idand__type, which is not a security control.Pimcore\Model\DataObject\Traits\CompositeIndexTrait::updateCompositeIndices()builds raw SQL with string concatenation and executes it via$this->db->executeQuery(...).quoteIdentifier()is used for theSHOW INDEXESquery, but not for the dynamicALTER TABLEstatements.index_keyorindex_columnsto known safe identifier characters.Confirmed source-to-sink path
importClassDefinitionFromJson()decodes attacker-controlled JSON and forwardscompositeIndices.setCompositeIndices()stores those values without sanitizing identifier content.ClassDefinition::save()reachesClassDefinition\Dao::update().Dao::update()callsupdateCompositeIndices()for:object_store_<classId>object_query_<classId>Localizedfield\Daoalso callsupdateCompositeIndices()for:Why this is exploitable
The vulnerable
ADD INDEXstatement is built as:$columnNameis produced fromimplode(',', $columns)and is not quoted or validated. A maliciousindex_columnselement such as:produces SQL of the form:
This remains a single
ALTER TABLEstatement, so the base vulnerability does not depend on multi-statement support. The attacker can inject additional DDL clauses affecting the target Pimcore object table.Impact
The issue allows a privileged attacker to alter backend SQL behavior during class-definition import/save and modify schema on Pimcore object tables associated with the affected class.
Practical impact includes:
index_keyis also concatenated into SQL without proper identifier escaping, but the most defensible exploitation path is throughindex_columns.Relevant code:
models/DataObject/ClassDefinition/Service.php:92-137models/DataObject/ClassDefinition.php:994-1006models/DataObject/Traits/CompositeIndexTrait.php:30-85models/DataObject/ClassDefinition/Dao.php:217-218models/DataObject/Localizedfield/Dao.php:945-951PoC
Application-level PoC
Preconditions:
compositeIndicesThe original report reproduced the issue through an authenticated Studio endpoint:
Minimal malicious JSON fragment:
{ "compositeIndices": [ { "index_key": "poc_idx", "index_type": "query", "index_columns": [ "slider), DROP COLUMN `oo_className` -- " ] } ] }Reproduction:
compositeIndicessection with the payload above.Expected result:
updateCompositeIndices()during class save/import.ALTER TABLEstatement against the target object table.Minimal source-level confirmation
The behavior is directly visible from the code path:
No escaping or allowlist validation is applied to
$columnsbefore they are interpolated into SQL.Evidence of Exploitation
https://github.com/user-attachments/assets/64a49147-12a5-4550-ba22-cb4383523557
System Information
Pimcore Platform
Version
v12.3.3Database layer:
doctrine/dbal^4.4Operating System: Any
Resources
Github Repository: https://github.com/pimcore/pimcore
Security: https://github.com/pimcore/pimcore/security
This issue was discovered by Oscar Uribe, Security Researcher at Fluid Attacks, who reached out to Pimcore.
As part of standard disclosure measures, Fluid Attacks follows a timeline (outlined at https://fluidattacks.com/advisories/policy) that is aligned with ISO/IEC 29147:2018 and ISO/IEC 30111:2019. In short, the timeline works as follows: Fluid Attacks requests acknowledgment of the report within a few days of project maintainers first accessing it, and from there, Fluid Attacks is glad to coordinate a joint disclosure date with the affected party, typically within 90 days of the initial discovery. This allows the maintainers' team reasonable time to assess, develop, and release a fix.
The CVE ID "CVE-2026-5394" has been reserved for this issue, and the advisory will eventually be published at https://fluidattacks.com/advisories/dragons.
References