Summary
Pimcore contains a high-severity SQL injection vulnerability in ClassDefinition handling. An authenticated user with object-management permission may provide a specially crafted class identifier that can cause SQL syntax to be inserted into queries, potentially exposing or modifying arbitrary Pimcore database tables.
Affected context
The issue occurs in Pimcore versions before 2026.1.5 when an authenticated user has permission to manage objects and can submit a ClassDefinition UID. Risk is present when a data object using a Block field is later loaded and the stored class identifier is incorporated into an unquoted database table identifier. Partial validation of the identifier allows values with valid prefixes but unsafe trailing content.
Exploit preconditions
- Attack surface: Pimcore object and ClassDefinition management functionality
- Required access: An authenticated account with the relevant objects permission
- Trigger point: Loading a data object containing a Block field
- Why exploitation is possible: Name and ID validation checks only the beginning of the supplied value, while the resulting class ID is later used in an unquoted SQL identifier
Why this happens
The vulnerability combines incomplete input validation with unsafe construction of SQL identifiers. Validation applies a start anchor but does not require the entire ClassDefinition name or ID to match the intended format, allowing additional SQL syntax to remain. Later, Block loading incorporates the stored identifier into a query without safely delimiting or structurally validating it. This maps primarily to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection) and also to CWE-20: Improper Input Validation.
Potential impact
- An attacker may read arbitrary Pimcore database tables
- Password hashes and other sensitive records could be disclosed
- An attacker could modify or delete application data
- Database integrity and application behavior could be compromised
- The vulnerability could support broader compromise depending on database privileges
General mitigation guidance
Mitigation generally focuses on enforcing complete validation and preventing user-controlled identifiers from becoming SQL syntax.
Common defensive patterns include:
- Require full-string matches against a strict allowlist for class names and identifiers
- Reject unexpected characters, delimiters, whitespace, and trailing content
- Use trusted internal mappings from validated identifiers to database objects rather than accepting table names directly
- Apply database APIs that safely quote identifiers where dynamic identifiers are unavoidable
- Keep application database accounts limited to the tables and operations they require
- Treat object metadata and ClassDefinition values as untrusted until validated at every relevant boundary
How teams detect issues like this
Detection can include:
- Static analysis rules for SQL query construction using concatenated or interpolated identifiers
- Code review checks for regular expressions that anchor only the beginning of an input
- Tests that verify complete-string validation and reject appended delimiters or SQL metacharacters
- Monitoring for unusual ClassDefinition changes, object metadata updates, and database queries involving unexpected identifiers
- Policy enforcement requiring parameterized values, approved identifier-mapping functions, and least-privilege database roles
Automated security review tools may help identify partial validation and dynamic SQL construction patterns.

