GIVE YOUR AGENT THE EVIDENCE

Set up in your agent.

One prompt to get started. Paste it into your coding agent to connect cve.new through MCP and bring vulnerability context into your workflow.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GIVE YOUR AGENT THE EVIDENCE

Investigate in your agent.

Turn this advisory into a focused investigation. Ask your agent to check your project’s versions, explain the evidence, and suggest a compatible fix.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GHSA-2xmm-g482-4439critical9.8

DQL injection through sorting parameters blocked

Check your stack

The advisory, in context

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

// 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:

# config/services.yaml
services:
    # ...
    sylius.grid.sorter:
        class: App\Sorting\Sorter

For more information

If you have any questions or comments about this advisory:

Affected packages

Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.

Ecosystem versions

Earlier releases before 1.10.1

Fixed in 1.10.1

108 explicitly affected versions

1.0.0-patch1, 1.2.4-patch1, 1.4.0-patch1, v1.0.0, v1.0.0-alpha.1, v1.0.0-alpha.2, v1.0.0-beta.1, v1.0.0-beta.2, v1.0.0-beta.3, v1.0.0-rc.1, v1.0.0-rc.2, v1.0.1, v1.0.10, v1.0.11, v1.0.12, v1.0.13, v1.0.14, v1.0.15, v1.0.16, v1.0.17, v1.0.18, v1.0.2, v1.0.3, v1.0.4, v1.0.5, v1.0.6, v1.0.7, v1.0.8, v1.0.9, v1.1.0, v1.1.0-RC, v1.1.1, v1.1.10, v1.1.11, v1.1.12, v1.1.13, v1.1.14, v1.1.15, v1.1.17, v1.1.18, v1.1.19, v1.1.2, v1.1.3, v1.1.4, v1.1.5, v1.1.6, v1.1.7, v1.1.8, v1.1.9, v1.10.0, v1.2.0, v1.2.0-BETA, v1.2.0-RC, v1.2.1, v1.2.10, v1.2.11, v1.2.12, v1.2.13, v1.2.14, v1.2.15, v1.2.16, v1.2.17, v1.2.18, v1.2.2, v1.2.3, v1.2.4, v1.2.5, v1.2.6, v1.2.7, v1.2.8, v1.2.9, v1.3.0, v1.3.0-BETA, v1.3.1, v1.3.10, v1.3.11, v1.3.12, v1.3.13, v1.3.2, v1.3.3, v1.3.4, v1.3.5, v1.3.6, v1.3.7, v1.3.8, v1.3.9, v1.4.0, v1.4.0-BETA.1, v1.4.1, v1.4.2, v1.4.3, v1.4.4, v1.4.5, v1.5.0, v1.5.1, v1.6.0, v1.6.1, v1.6.2, v1.6.3, v1.7.0, v1.7.1, v1.7.2, v1.7.3, v1.7.4, v1.7.5, v1.8.0, v1.8.0-BETA.1, v1.9.0

View affected-version evidence
{
  "ranges": [
    {
      "events": [
        {
          "introduced": "0"
        },
        {
          "fixed": "1.10.1"
        }
      ],
      "type": "ECOSYSTEM"
    }
  ],
  "versions": [
    "1.0.0-patch1",
    "1.2.4-patch1",
    "1.4.0-patch1",
    "v1.0.0",
    "v1.0.0-alpha.1",
    "v1.0.0-alpha.2",
    "v1.0.0-beta.1",
    "v1.0.0-beta.2",
    "v1.0.0-beta.3",
    "v1.0.0-rc.1",
    "v1.0.0-rc.2",
    "v1.0.1",
    "v1.0.10",
    "v1.0.11",
    "v1.0.12",
    "v1.0.13",
    "v1.0.14",
    "v1.0.15",
    "v1.0.16",
    "v1.0.17",
    "v1.0.18",
    "v1.0.2",
    "v1.0.3",
    "v1.0.4",
    "v1.0.5",
    "v1.0.6",
    "v1.0.7",
    "v1.0.8",
    "v1.0.9",
    "v1.1.0",
    "v1.1.0-RC",
    "v1.1.1",
    "v1.1.10",
    "v1.1.11",
    "v1.1.12",
    "v1.1.13",
    "v1.1.14",
    "v1.1.15",
    "v1.1.17",
    "v1.1.18",
    "v1.1.19",
    "v1.1.2",
    "v1.1.3",
    "v1.1.4",
    "v1.1.5",
    "v1.1.6",
    "v1.1.7",
    "v1.1.8",
    "v1.1.9",
    "v1.10.0",
    "v1.2.0",
    "v1.2.0-BETA",
    "v1.2.0-RC",
    "v1.2.1",
    "v1.2.10",
    "v1.2.11",
    "v1.2.12",
    "v1.2.13",
    "v1.2.14",
    "v1.2.15",
    "v1.2.16",
    "v1.2.17",
    "v1.2.18",
    "v1.2.2",
    "v1.2.3",
    "v1.2.4",
    "v1.2.5",
    "v1.2.6",
    "v1.2.7",
    "v1.2.8",
    "v1.2.9",
    "v1.3.0",
    "v1.3.0-BETA",
    "v1.3.1",
    "v1.3.10",
    "v1.3.11",
    "v1.3.12",
    "v1.3.13",
    "v1.3.2",
    "v1.3.3",
    "v1.3.4",
    "v1.3.5",
    "v1.3.6",
    "v1.3.7",
    "v1.3.8",
    "v1.3.9",
    "v1.4.0",
    "v1.4.0-BETA.1",
    "v1.4.1",
    "v1.4.2",
    "v1.4.3",
    "v1.4.4",
    "v1.4.5",
    "v1.5.0",
    "v1.5.1",
    "v1.6.0",
    "v1.6.1",
    "v1.6.2",
    "v1.6.3",
    "v1.7.0",
    "v1.7.1",
    "v1.7.2",
    "v1.7.3",
    "v1.7.4",
    "v1.7.5",
    "v1.8.0",
    "v1.8.0-BETA.1",
    "v1.9.0"
  ]
}

References