CVE-2022-24752
highpriority · track · 39EPSS 0.014 · 72 %ileEURUUSEPSS · scored 2026-10-27
SyliusGridBundle is a package of generic data grids for Symfony applications. Prior to versions 1.10.1 and 1.11-rc2, values added at the end of query sorting were passed directly to the database. The maintainers do not know if this could lead to direct SQL injections but took steps to remediate the vulnerability. The issue is fixed in versions 1.10.1 and 1.11-rc2. As a workaround, overwrite the`Sylius\Component\Grid\Sorting\Sorter.php` class and register it in the container. More information about this workaround is available in the GitHub Security Advisory.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · high–critical · 7.5–9.8
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (7)
Products and version ranges known to be affected.
advisories (1)
Vendor and ecosystem advisories describing this.
- GHSA-2xmm-g482-4439DQL injection through sorting parameters blocked2022-03-15ghsa · osvUS
### Impact Values added at the end of query sorting were passed directly to the DB. We don't know, if it could lead to direct SQL injections, however, we should not allow for easy injection of values there anyway. ### Patches The issue is fixed in version 1.10.1 and in 1.11-rc.1 ### Workarounds You have to overwrite your `Sylius\Component\Grid\Sorting\Sorter.php` class: ```php <?php // src/App/Sorting/Sorter.php declare(strict_types=1); namespace App\Sorting; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Sylius\Component\Grid\Data\DataSourceInterface; use Sylius\Component\Grid\Definition\Grid; use Sylius\Component\Grid\Parameters; use Sylius\Component\Grid\Sorting\SorterInterface; final class Sorter implements SorterInterface { public function sort(DataSourceInterface $dataSource, Grid $grid, Parameters $parameters): void { $enabledFields = $grid->getFields(); $expressionBuilder = $dataSource->getExpressionBuilder(); $sorting = $parameters->get('sorting', $grid->getSorting()); $this->validateSortingParams($sorting, $enabledFields); foreach ($sorting as $field => $order) { $this->validateFieldNames($field, $enabledFields); $gridField = $grid->getField($field); $property = $gridField->getSortable(); if (null !== $property) { $expressionBuilder->addOrderBy($property, $order); } } } private function validateSortingParams(array $sorting, array $enabledFields): void { foreach (array_keys($enabledFields) as $key) { if (array_key_exists($key, $sorting) && !in_array($sorting[$key], ['asc', 'desc'])) { throw new BadRequestHttpException(sprintf('%s is not valid, use asc or desc instead.', $sorting[$key])); } } } private function validateFieldNames(string $fieldName, array $enabledFields): void { $enabledFieldsNames = array_keys($enabledFields); if (!in_array($fieldName, $enabledFieldsNames, true)) { throw new BadRequestHttpException(sprintf('%s is not valid field, did you mean one of these: %s?', $fieldName, implode(', ', $enabledFieldsNames))); } } } ``` and register it in your container: ```yaml # config/services.yaml services: # ... sylius.grid.sorter: class: App\Sorting\Sorter ``` ### For more information If you have any questions or comments about this advisory: * Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues) * Email us at [security@sylius.com](mailto:security@sylius.com)
also known as (5)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (17)
External citations — patches, advisories, analysis.
- https://cxsecurity.com/cveshow/CVE-2022-24752/cnnvd
- https://github.com/Sylius/SyliusGridBundle/commit/73d0791d0575f955e830a3da4c3345f420d2f784cnnvd
- https://github.com/Sylius/SyliusGridBundle/pull/222cnnvd
- https://github.com/Sylius/SyliusGridBundle/releases/tag/v1.10.1cnnvd
- https://github.com/Sylius/SyliusGridBundle/releases/tag/v1.11.0-RC.2cnnvd
- https://github.com/Sylius/SyliusGridBundle/security/advisories/GHSA-2xmm-g482-4439cnnvd
- https://www.cybersecurity-help.cz/vdb/SB2022032115cnnvd
- https://github.com/Sylius/SyliusGridBundle/commit/73d0791d0575f955e830a3da4c3345f420d2f784enisa_euvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan