Improper quoting of columns when using setOrderBy() or setGroupBy() on listing classes in Pimcore
Description
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
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:
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