Summary
Sylius: Channel-based payment method restriction bypass on shop account orders API endpoint
Full technical description
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
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):
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
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:
- Open an issue in Sylius issues
- Send an email to [email protected]
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.
The application does not correctly enforce access controls, allowing a principal to access resources or operations beyond their granted permissions. Typical impact: unauthorized data access or execution of privileged operations.
CVE-2026-53638 has a CVSS score of 4.3 (Medium). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.0.18, 2.1.15, 2.2.6); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
The issue is fixed in versions: 2.0.18, 2.1.15, 2.2.6 and above.
Frequently Asked Questions
- What is CVE-2026-53638? CVE-2026-53638 is a medium-severity incorrect authorization vulnerability in sylius/sylius (composer), affecting versions >= 2.0.0, < 2.0.18. It is fixed in 2.0.18, 2.1.15, 2.2.6. The application does not correctly enforce access controls, allowing a principal to access resources or operations beyond their granted permissions.
- How severe is CVE-2026-53638? CVE-2026-53638 has a CVSS score of 4.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of sylius/sylius are affected by CVE-2026-53638? sylius/sylius (composer) versions >= 2.0.0, < 2.0.18 is affected.
- Is there a fix for CVE-2026-53638? Yes. CVE-2026-53638 is fixed in 2.0.18, 2.1.15, 2.2.6. Upgrade to this version or later.
- Is CVE-2026-53638 exploitable, and should I be worried? Whether CVE-2026-53638 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-53638 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-53638?
- Upgrade
sylius/syliusto 2.0.18 or later - Upgrade
sylius/syliusto 2.1.15 or later - Upgrade
sylius/syliusto 2.2.6 or later
- Upgrade