Advisory

GHSA-79cw-hfcc-7mw9

Details, part 2 of 2. The advisory

Details

Impact

An authenticated user with website_settings permission (or any permission granting access to a listing endpoint with DateFilter support) extracts the full contents of any database table one character at a time through conditional time-based blind SQL injection.

Directly extractable high-value data:

  • Admin password hashes (users.password) for offline cracking
  • Password recovery tokens (users.passwordRecoveryToken) for direct account takeover via POST /login/token
  • Session data for session hijacking
  • All PIM product data, CMS content, and asset metadata

Affected Endpoints

All endpoints using ListingFilter::applyFilters() with a DateFilter on column filter:

  • POST /pimcore-studio/api/website-settings
  • POST /pimcore-studio/api/notifications
  • POST /pimcore-studio/api/recycle-bin
  • POST /pimcore-studio/api/redirects
  • POST /pimcore-studio/api/translations/{domain}
  • POST /pimcore-studio/api/quantity-value/units
  • POST /pimcore-studio/api/properties
  • POST /pimcore-studio/api/classification-store/{storeId}/keys
  • POST /pimcore-studio/api/classification-store/{storeId}/groups
  • POST /pimcore-studio/api/classification-store/{storeId}/collections
  • GET /pimcore-studio/api/notes/{elementType}/{id} (via Note FilterService fieldFilters)

Recommended Fix

Replace manual backtick wrapping with Doctrine\DBAL\Connection::quoteIdentifier(), or implement a per-listing allowlist of valid column names:

// Option 1: quoteIdentifier (doubles internal backticks)
$db = \Pimcore\Db::get();
$dateCondition = $db->quoteIdentifier($key) . ' BETWEEN :minTime AND :maxTime';

// Option 2: allowlist (preferred)
private const ALLOWED_COLUMNS = ['id', 'name', 'date', 'type', 'creationDate', 'modificationDate'];
if (!in_array($key, self::ALLOWED_COLUMNS, true)) {
    throw new InvalidArgumentException('Invalid filter column');
}

Apply the same fix to EqualsFilter, LikeFilter, and Note/FilterService as defense-in-depth, even though those are currently protected by PDO named parameter validation.

Supporting Materials

  • Live-tested on Pimcore 12.x (2026.x branch, commit 82f9ff6), Docker, PHP 8.4, MariaDB 10.11
  • MySQL general query log confirms injected SQL reaches the database
  • The safe pattern (quoteIdentifier()) exists in the same codebase in LogRepository.php line 202
  • Package: pimcore/studio-backend-bundle

Sources & licences