VYPR
Moderate severityNVD Advisory· Published Mar 11, 2025· Updated Mar 12, 2025

Pimcore Vulnerable to SQL Injection in getRelationFilterCondition

CVE-2025-27617

Description

Pimcore is an open source data and experience management platform. Prior to version 11.5.4, authenticated users can craft a filter string used to cause a SQL injection. Version 11.5.4 fixes the issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
pimcore/pimcorePackagist
< 11.5.411.5.4

Affected products

1

Patches

1
19a852089548

[Task]: Improve quotation in RelationFilterConditionParser (#18184)

https://github.com/pimcore/pimcoreJiaJia JiMar 11, 2025via ghsa
1 file changed · +9 4
  • models/DataObject/ClassDefinition/Data/Extension/RelationFilterConditionParser.php+9 4 modified
    @@ -16,6 +16,8 @@
     
     namespace Pimcore\Model\DataObject\ClassDefinition\Data\Extension;
     
    +use Pimcore\Db\Helper;
    +
     /**
      * Trait RelationFilterConditionParser
      *
    @@ -28,16 +30,19 @@ trait RelationFilterConditionParser
          */
         public function getRelationFilterCondition(?string $value, string $operator, string $name): string
         {
    -        $result = '`' . $name . '` IS NULL';
    +        $db = \Pimcore\Db::get();
    +        $result = $db->quoteIdentifier($name) . ' IS NULL';
             if ($value === null || $value === 'null') {
                 return $result;
             }
             if ($operator === '=') {
    -            return '`' . $name . '` = ' . "'" . $value . "'";
    +            return $db->quoteIdentifier($name) . ' = ' . $db->quote($value);
             }
             $values = explode(',', $value);
    -        $fieldConditions = array_map(function ($value) use ($name) {
    -            return '`' . $name . "` LIKE '%," . $value . ",%' ";
    +        $fieldConditions = array_map(function ($value) use ($name, $db) {
    +            $quotedValue = $db->quote('%,' . Helper::escapeLike($value) . ',%');
    +
    +            return $db->quoteIdentifier($name) . ' LIKE ' . $quotedValue . ' ';
             }, array_filter($values));
             if (!empty($fieldConditions)) {
                 $result = '(' . implode(' AND ', $fieldConditions) . ')';
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.