Advisory

GHSA-gvmf-wcx6-p974

Also known as: CVE-2022-31092

Summary

Improper quoting of columns when using setOrderBy() or setGroupBy() on listing classes in Pimcore

Details

Impact
Pimcore offers developers listing classes to make querying data easier. This listing classes also allow to order or group the results based on one or more columns which should be quoted by default.
The actual issue is that quoting is not done properly in both cases, so there's the theoretical possibility to inject custom SQL if the developer is using this methods with input data and not doing proper input validation in advance and so relies on the auto-quoting being done by the listing classes.

Example:

// request url: https://example.com/foo?groupBy=o_id`; SELECT SLEEP(20);--

$list = new DataObject\Car\Listing();
$list->setOrderKey($request->get('orderBy'));
$list->setGroupBy($request->get('groupBy'));
$list->load();

Patches
Upgrade to >= 10.4.4 or apply the following patch manually:
https://github.com/pimcore/pimcore/commit/21559c6bf0e4e828d33ff7af6e88caecb5ac6549.patch

Workarounds
Apply this patch manually:
https://github.com/pimcore/pimcore/commit/21559c6bf0e4e828d33ff7af6e88caecb5ac6549.patch

References
https://github.com/pimcore/pimcore/pull/12444

Severity

High Basis: The source's own band: HIGH

Dates

Published
2022-06-22 17:58 UTC
Modified
2023-11-08 04:09 UTC

Affected packages and fixes

pimcore/pimcore

Packagist · All systems

Affected

  • introduced 0, fixed 10.4.4 (ecosystem)

Fixed versions

10.4.4

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences