All vulnerabilities

Servers and applications

CVE-2026-31825

DQL Injection via API Order Filters

Severity
Medium 5.3
Published
9 Mar 2026
Last changed
17 Jun 2026
Added to UpHeron
1 Nov 2026
Fixed in
1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3
Exploit chance
0.2% in the next 30 daysHigher than 13% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
SQL injection (CWE-89)NoSQL injection (CWE-943)
Attack
Over the network · No login needed · No user action needed
Attacker can
Read some data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Also known as
GHSA-xcwx-r2gw-w93m
Sources
NVD, Project advisories (GitHub)

Description

Sylius API filters ProductPriceOrderFilter and TranslationOrderNameAndLocaleFilter pass user-supplied order direction values directly to Doctrine's orderBy() without validation. An attacker can inject arbitrary DQL:

src/EventSubscriber/SanitizeOrderDirectionSubscriber.php:

Option A — If your config/services.yaml already has App\ autowiring (Symfony default):

Option B — If there is no App\ autowiring:

Using %sylius.security.new_api_route% ties the subscriber to the same prefix Sylius uses (/api/v2 by default). If the parameter is not available, hardcode '/api/v2' instead.

We would like to extend our gratitude to the following individuals for their detailed reporting and responsible disclosure of this vulnerability:

  • Chris Alupului (@Neosprings)
  • Bartłomiej Nowiński (@bnBart)
From Sylius/Sylius's security advisory.

Workarounds

An EventSubscriber that sanitizes order query parameters only on API routes before they reach the vulnerable filters.

The subscriber accepts an $apiRoute constructor parameter (default /api/v2) and skips non-API requests entirely — so there is zero overhead on shop/admin page requests.

This follows the same pattern used by Sylius's own KernelRequestEventSubscriber (src/Sylius/Bundle/ApiBundle/EventSubscriber/KernelRequestEventSubscriber.php), which also uses str_contains($pathInfo, $this->apiRoute) to scope logic to API routes.

Workarounds as given by Sylius/Sylius's security advisory.

Affected software

SoftwareAffected versions
SyliusServers and applications · cpe:a:sylius:sylius
  • From 2.2.0 before 2.2.3
  • From 2.1.0 before 2.1.12
  • From 2.0.0 before 2.0.16
  • From 1.14.0 before 1.14.18
All 9 release lines
  • Every version before 1.9.12
  • From 1.10.0 before 1.10.16
  • From 1.11.0 before 1.11.17
  • From 1.12.0 before 1.12.23
  • From 1.13.0 before 1.13.15
  • From 1.14.0 before 1.14.18
  • From 2.0.0 before 2.0.16
  • From 2.1.0 before 2.1.12
  • From 2.2.0 before 2.2.3
SyliusServers and applications · github:sylius/sylius
  • Every version before 1.9.12

About Sylius

Headless open-source eCommerce platform on top of PHP/Symfony/API Platform

From its GitHub repository.
Online stores using it
10 000+Sylius
Monthly downloads (Packagist)
173,262Packagist, 15 Nov 2026
Total downloads (Packagist)
6,561,739Packagist, 15 Nov 2026
GitHub stars
8,571GitHub, 15 Nov 2026
Forks
2,167GitHub, 15 Nov 2026
Latest release
v2.3.2GitHub, 15 Nov 2026
Released
22 Oct 2026GitHub
License
MITGitHub
First published on GitHub
5 Nov 2011GitHub

Release lines

ReleaseLatestSecurity fixes
2.32.3.2Until 31 Dec 2027
2.22.2.12Until 31 Mar 2027
2.12.1.17Ended 30 Sept 2026
2.02.0.18Ended 28 Feb 2026
1.14 (LTS)LTS1.14.21Until 31 Dec 2026
1.131.13.17Ended 30 Apr 2025

From endoflife.date.

References

  • NVD https://nvd.nist.gov/vuln/detail/CVE-2026-31825
  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-31825
  • GitHub Advisory Database https://github.com/advisories/GHSA-xcwx-r2gw-w93m
  • github.com https://github.com/Sylius/Sylius/security/advisories/GHSA-xcwx-r2gw-w93m