Medium

Sylius: Channel-based payment method restriction bypass on shop account orders API endpoint

  • Disclosed: 09.07.2026
  • Updated: 11.10.2026 10:22

Impact

An authorization bypass vulnerability exists in the shop account API. The PATCH /api/v2/shop/account/orders/{tokenValue}/payments/{paymentId} endpoint, used by an authenticated shop customer to change the payment method of an order that has been placed but not yet paid (state STATE_NEW), does not validate that the chosen payment method is enabled for the order's channel. The equivalent checkout endpoint (PATCH /api/v2/shop/orders/{tokenValue}/payments/{paymentId}) correctly rejects out-of-channel payment methods with HTTP 422; the account endpoint silently accepts them and returns HTTP 200.

An authenticated customer can therefore assign any globally enabled payment method to their own placed order, including methods that the store operator has explicitly excluded from that channel.

Patches

The issue is fixed in versions: 2.0.18, 2.1.15, 2.2.6 and above.

Workarounds

If users cannot bump Sylius right now, decorate the Sylius\Bundle\ApiBundle\Changer\PaymentMethodChangerInterface service in their applications.

Step 1. Create the decorator

src/Decorator/ChannelCheckingPaymentMethodChanger.php:

php
<?php

declare(strict_types=1);

namespace App\Decorator;

use ApiPlatform\Validator\Exception\ValidationException;
use Sylius\Bundle\ApiBundle\Changer\PaymentMethodChangerInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\PaymentMethodInterface;
use Sylius\Component\Core\Repository\PaymentMethodRepositoryInterface;
use Sylius\Component\Core\Repository\PaymentRepositoryInterface;
use Sylius\Component\Payment\Resolver\PaymentMethodsResolverInterface;
use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\ConstraintViolationList;
use Symfony\Contracts\Translation\TranslatorInterface;

final readonly class ChannelCheckingPaymentMethodChanger implements PaymentMethodChangerInterface
{
    public function __construct(
        private PaymentMethodChangerInterface $decorated,
        private PaymentRepositoryInterface $paymentRepository,
        private PaymentMethodRepositoryInterface $paymentMethodRepository,
        private PaymentMethodsResolverInterface $paymentMethodsResolver,
        private TranslatorInterface $translator,
    ) {
    }

    public function changePaymentMethod(string $paymentMethodCode, mixed $paymentId, OrderInterface $order): OrderInterface
    {
        /** @var PaymentMethodInterface|null $paymentMethod */
        $paymentMethod = $this->paymentMethodRepository->findOneBy(['code' => $paymentMethodCode]);
        $payment = $this->paymentRepository->findOneByOrderId($paymentId, $order->getId());

        if (
            $paymentMethod !== null
            && $payment !== null
            && !in_array($paymentMethod, $this->paymentMethodsResolver->getSupportedMethods($payment), true)
        ) {
            $template = 'sylius.payment_method.not_available';
            $parameters = ['%name%' => (string) $paymentMethod->getName()];

            throw new ValidationException(new ConstraintViolationList([
                new ConstraintViolation(
                    message: $this->translator->trans($template, $parameters, 'validators'),
                    messageTemplate: $template,
                    parameters: $parameters,
                    root: $paymentMethodCode,
                    propertyPath: '',
                    invalidValue: $paymentMethodCode,
                ),
            ]));
        }

        return $this->decorated->changePaymentMethod($paymentMethodCode, $paymentId, $order);
    }
}

Step 2. Register the decorator

config/services.yaml (append to the application's existing services: block):

yaml
services:
    App\Decorator\ChannelCheckingPaymentMethodChanger:
        decorates: sylius_api.changer.payment_method
        arguments:
            - '@.inner'
            - '@sylius.repository.payment'
            - '@sylius.repository.payment_method'
            - '@sylius.resolver.payment_methods'
            - '@translator'

@.inner references the original PaymentMethodChangerInterface implementation, so any future Sylius change to the changer keeps working through the decorator.

Step 3. Clear the cache

bash
bin/console cache:clear

Reporters

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

  • Fredrik Dietrichson (@FredrikEV)

For more information

If there are any questions or comments about this advisory:

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Composer package sylius/sylius >= 2.0.0, < 2.0.18, >= 2.1.0, < 2.1.15, >= 2.2.0, < 2.2.6 2.0.18, 2.1.15, 2.2.6

References

CVSS score 4.3/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
Weakness (CWE)
CWE-863
Platform
Composer
Package
sylius/sylius
Disclosed
09.07.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-6955-hrm5-c4qp - CC BY 4.0

Vulnerability history: sylius/sylius

All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (23) in the archive
Total entries
23
First → latest
12.2019 07.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 4
  • Medium 17
  • Low 2

Disclosures per year

  1. 2019: 1
  2. 2020: 3
  3. 2021: 1
  4. 2022: 4
  5. 2023: 0
  6. 2024: 4
  7. 2025: 0
  8. 2026: 10
Severity:
  1. Sylius: Channel-based payment method restriction bypass on shop account orders API endpoint this entry
    Medium · 4.3 CVE-2026-53638 >= 2.0.0, < 2.0.18, >= 2.1.0, < 2.1.15, >= 2.2.0, < 2.2.6 2.0.18, 2.1.15, 2.2.6
  2. High · 8.2 CVE-2026-31824 < 1.9.12, >= 1.10.0, < 1.10.16, >= 1.11.0, < 1.11.17, >= 1.12.0, < 1.12.23, >= 1.13.0, < 1.13.15, >= 1.14.0, < 1.14.18, >= 2.0.0, < 2.0.16, >= 2.1.0, < 2.1.12, >= 2.2.0, < 2.2.3 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3
  3. High CVE-2026-31820 >= 2.0.0, < 2.0.16, >= 2.1.0, < 2.1.12, >= 2.2.0, < 2.2.3 2.0.16, 2.1.12, 2.2.3
  4. High · 7.5 CVE-2024-40633 >= 1.12.0-alpha.1, < 1.12.19, >= 1.13.0-alpha.1, < 1.13.4, < 1.9.12, >= 1.10.0-alpha.1, < 1.10.16, >= 1.11.0-alpha.1, < 1.11.17 1.12.19, 1.13.4, 1.9.12, 1.10.16, 1.11.17
  5. High · 7.1 CVE-2022-24743 >= 1.10.0, < 1.10.11, >= 1.11.0, < 1.11.2 1.10.11, 1.11.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.