Skip to content

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

High severity GitHub Reviewed Published Jun 22, 2022 in pimcore/pimcore • Updated Jan 27, 2023

Package

composer pimcore/pimcore (Composer)

Affected versions

< 10.4.4

Patched versions

10.4.4

Description

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

pimcore/pimcore#12444

References

@brusch brusch published to pimcore/pimcore Jun 22, 2022
Published to the GitHub Advisory Database Jun 22, 2022
Reviewed Jun 22, 2022
Published by the National Vulnerability Database Jun 27, 2022
Last updated Jan 27, 2023

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS score

0.303%
(70th percentile)

Weaknesses

CVE ID

CVE-2022-31092

GHSA ID

GHSA-gvmf-wcx6-p974

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.