VYPR
High severityNVD Advisory· Published Jan 24, 2024· Updated May 30, 2025

Pimcore Admin Classic Bundle SQL Injection in Admin download files as zip

CVE-2024-23646

Description

Pimcore's Admin Classic Bundle provides a backend user interface for Pimcore. The application allows users to create zip files from available files on the site. In the 1.x branch prior to version 1.3.2, parameter selectedIds is susceptible to SQL Injection. Any backend user with very basic permissions can execute arbitrary SQL statements and thus alter any data or escalate their privileges to at least admin level. Version 1.3.2 contains a fix for this issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
pimcore/admin-ui-classic-bundlePackagist
>= 1.0.0, < 1.3.21.3.2

Affected products

1

Patches

1
363afef29496

fix: add quote for ids processed in downloadAsZipAddFilesAction method (#405)

1 file changed · +15 9
  • src/Controller/Admin/Asset/AssetController.php+15 9 modified
    @@ -2015,10 +2015,10 @@ public function downloadAsZipJobsAction(Request $request): JsonResponse
                     $userIds = $this->getAdminUser()->getRoles();
                     $userIds[] = $this->getAdminUser()->getId();
                     $conditionFilters[] = ' (
    -                                                    (select list from users_workspaces_asset where userId in (' . implode(',', $userIds) . ') and LOCATE(CONCAT(`path`, filename),cpath)=1  ORDER BY LENGTH(cpath) DESC LIMIT 1)=1
    -                                                    OR
    -                                                    (select list from users_workspaces_asset where userId in (' . implode(',', $userIds) . ') and LOCATE(cpath,CONCAT(`path`, filename))=1  ORDER BY LENGTH(cpath) DESC LIMIT 1)=1
    -                                                 )';
    +                   (select list from users_workspaces_asset where userId in (' . implode(',', $userIds) . ') and LOCATE(CONCAT(`path`, filename),cpath)=1  ORDER BY LENGTH(cpath) DESC LIMIT 1)=1
    +                   OR
    +                   (select list from users_workspaces_asset where userId in (' . implode(',', $userIds) . ') and LOCATE(cpath,CONCAT(`path`, filename))=1  ORDER BY LENGTH(cpath) DESC LIMIT 1)=1
    +                )';
                 }
     
                 $condition = implode(' AND ', $conditionFilters);
    @@ -2088,18 +2088,24 @@ public function downloadAsZipAddFilesAction(Request $request): JsonResponse
     
                     if (!empty($selectedIds)) {
                         $selectedIds = explode(',', $selectedIds);
    +                    $quotedSelectedIds = [];
    +                    foreach ($selectedIds as $selectedId) {
    +                        if ($selectedId) {
    +                            $quotedSelectedIds[] = $db->quote($selectedId);
    +                        }
    +                    }
                         //add a condition if id numbers are specified
    -                    $conditionFilters[] = 'id IN (' . implode(',', $selectedIds) . ')';
    +                    $conditionFilters[] = 'id IN (' . implode(',', $quotedSelectedIds) . ')';
                     }
                     $conditionFilters[] = "`type` != 'folder' AND `path` like " . $db->quote(Helper::escapeLike($parentPath) . '/%');
                     if (!$this->getAdminUser()->isAdmin()) {
                         $userIds = $this->getAdminUser()->getRoles();
                         $userIds[] = $this->getAdminUser()->getId();
                         $conditionFilters[] = ' (
    -                                                    (select list from users_workspaces_asset where userId in (' . implode(',', $userIds) . ') and LOCATE(CONCAT(`path`, filename),cpath)=1  ORDER BY LENGTH(cpath) DESC LIMIT 1)=1
    -                                                    OR
    -                                                    (select list from users_workspaces_asset where userId in (' . implode(',', $userIds) . ') and LOCATE(cpath,CONCAT(`path`, filename))=1  ORDER BY LENGTH(cpath) DESC LIMIT 1)=1
    -                                                 )';
    +                       (select list from users_workspaces_asset where userId in (' . implode(',', $userIds) . ') and LOCATE(CONCAT(`path`, filename),cpath)=1  ORDER BY LENGTH(cpath) DESC LIMIT 1)=1
    +                       OR
    +                       (select list from users_workspaces_asset where userId in (' . implode(',', $userIds) . ') and LOCATE(cpath,CONCAT(`path`, filename))=1  ORDER BY LENGTH(cpath) DESC LIMIT 1)=1
    +                    )';
                     }
     
                     $condition = implode(' AND ', $conditionFilters);
    

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

7

News mentions

0

No linked articles in our index yet.