CVE-2025-29788: Sylius/paypal plugin Sylius PayPal Plugin Payment Amount Vulnerability
MODERATECVE-2025-29788 is a MODERATE (CVSS 6.5) sylius paypal plugin payment amount vulnerability (CWE-472: External Control of Assumed-Immutable Web Parameter) affecting Sylius/paypal plugin libraries in the Packagist ecosystem. The issue involves sylius paypal plugin payment amount manipulation vulnerability. Remediation is available by upgrading affected packages to version 1.6.1, 1.7.1, 2.0.1.
CVE-2025-29788 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N).
How to Fix CVE-2025-29788
To remediate this vulnerability, upgrade all affected Sylius/paypal plugin dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade sylius/paypal-plugin to 1.6.1
Upgrade sylius/paypal-plugin to 1.7.1
Upgrade sylius/paypal-plugin to 2.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for sylius/paypal-plugin
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-29788, inspect your project dependencies for Sylius/paypal plugin:
inspect dependencies for sylius/paypal-plugin
Analyze the terminal output to locate any version of Sylius/paypal plugin in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-472: External Control of Assumed-Immutable Web Parameter, where the web application does not sufficiently verify inputs that are assumed to be immutable but are actually externally controllable, such as hidden form fields. In Sylius/paypal plugin, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-29788 Affected Sylius/paypal plugin Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sylius/paypal-plugin
|
Packagist |
< 1.6.1
|
1.6.1
|
|
sylius/paypal-plugin
|
Packagist |
≥ 1.7.0
< 1.7.1
|
1.7.1
|
|
sylius/paypal-plugin
|
Packagist |
≥ 2.0.0
< 2.0.1
|
2.0.1
|
References
Frequently Asked Questions
What is CVE-2025-29788?
Which Sylius/paypal plugin versions are affected?
What version fixes CVE-2025-29788?
Is sylius/paypal-plugin affected?
What is the CVSS score of CVE-2025-29788?
What CWE is associated with CVE-2025-29788?
How can I check Packagist dependencies for CVE-2025-29788?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pqq3-q84h-pj6x",
"modified" : "2025-03-17T21:26:51Z",
"published" : "2025-03-17T21:26:50Z",
"aliases" : [ "CVE-2025-29788" ],
"summary" : "Sylius PayPal Plugin Payment Amount Manipulation Vulnerability",
"details" : "A vulnerability allows users to manipulate the final payment amount processed by PayPal. If a user modifies the item quantity in their shopping cart after initiating the PayPal Checkout process, PayPal will not receive the updated total amount. As a result, PayPal captures only the initially transmitted amount, while Sylius incorrectly considers the order fully paid based on the modified total. This flaw can be exploited both accidentally and intentionally, potentially enabling fraud by allowing customers to pay less than the actual order value.\n\n### Impact\n\n- Attackers can intentionally pay less than the actual total order amount.\n- Business owners may suffer financial losses due to underpaid orders.\n- Integrity of payment processing is compromised.\n\n### Patches\n\nThe issue is fixed in versions: 1.6.1, 1.7.1, 2.0.1 and above.\n\n### Workarounds\n\nTo resolve the problem in the end application without updating to the newest patches, there is a need to overwrite `ProcessPayPalOrderAction` with modified logic:\n\n```php\n<?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Controller;\n\nuse Doctrine\\Persistence\\ObjectManager;\nuse SM\\Factory\\FactoryInterface as StateMachineFactoryInterface;\nuse Sylius\\Abstraction\\StateMachine\\StateMachineInterface;\nuse Sylius\\Abstraction\\StateMachine\\WinzouStateMachineAdapter;\nuse Sylius\\Component\\Core\\Factory\\AddressFactoryInterface;\nuse Sylius\\Component\\Core\\Model\\CustomerInterface;\nuse Sylius\\Component\\Core\\Model\\PaymentInterface;\nuse Sylius\\Component\\Core\\Model\\PaymentMethodInterface;\nuse Sylius\\Component\\Core\\OrderCheckoutTransitions;\nuse Sylius\\Component\\Core\\Repository\\CustomerRepositoryInterface;\nuse Sylius\\Component\\Resource\\Factory\\FactoryInterface;\nuse Sylius\\PayPalPlugin\\Api\\CacheAuthorizeClientApiInterface;\nuse Sylius\\PayPalPlugin\\Api\\OrderDetailsApiInterface;\nuse Sylius\\PayPalPlugin\\Manager\\PaymentStateManagerInterface;\nuse Sylius\\PayPalPlugin\\Provider\\OrderProviderInterface;\nuse Sylius\\PayPalPlugin\\Verifier\\PaymentAmountVerifierInterface;\nuse Symfony\\Component\\HttpFoundation\\JsonResponse;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\n\nfinal class ProcessPayPalOrderAction\n{\n public function __construct(\n private readonly CustomerRepositoryInterface $customerRepository,\n private readonly FactoryInterface $customerFactory,\n private readonly AddressFactoryInterface $addressFactory,\n private readonly ObjectManager $orderManager,\n private readonly StateMachineFactoryInterface|StateMachineInterface $stateMachineFactory,\n private readonly PaymentStateManagerInterface $paymentStateManager,\n private readonly CacheAuthorizeClientApiInterface $authorizeClientApi,\n private readonly OrderDetailsApiInterface $orderDetailsApi,\n private readonly OrderProviderInterface $orderProvider,\n ) {\n }\n\n public function __invoke(Request $request): Response\n {\n $orderId = $request->request->getInt('orderId');\n $order = $this->orderProvider->provideOrderById($orderId);\n /** @var PaymentInterface $payment */\n $payment = $order->getLastPayment(PaymentInterface::STATE_CART);\n\n $data = $this->getOrderDetails((string) $request->request->get('payPalOrderId'), $payment);\n\n /** @var CustomerInterface|null $customer */\n $customer = $order->getCustomer();\n if ($customer === null) {\n $customer = $this->getOrderCustomer($data['payer']);\n $order->setCustomer($customer);\n }\n\n $purchaseUnit = (array) $data['purchase_units'][0];\n\n $address = $this->addressFactory->createNew();\n\n if ($order->isShippingRequired()) {\n $name = explode(' ', $purchaseUnit['shipping']['name']['full_name']);\n $address->setLastName(array_pop($name) ?? '');\n $address->setFirstName(implode(' ', $name));\n $address->setStreet($purchaseUnit['shipping']['address']['address_line_1']);\n $address->setCity($purchaseUnit['shipping']['address']['admin_area_2']);\n $address->setPostcode($purchaseUnit['shipping']['address']['postal_code']);\n $address->setCountryCode($purchaseUnit['shipping']['address']['country_code']);\n\n $this->getStateMachine()->apply($order, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_ADDRESS);\n $this->getStateMachine()->apply($order, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_SELECT_SHIPPING);\n } else {\n $address->setFirstName($customer->getFirstName());\n $address->setLastName($customer->getLastName());\n\n $defaultAddress = $customer->getDefaultAddress();\n\n $address->setStreet($defaultAddress ? $defaultAddress->getStreet() : '');\n $address->setCity($defaultAddress ? $defaultAddress->getCity() : '');\n $address->setPostcode($defaultAddress ? $defaultAddress->getPostcode() : '');\n $address->setCountryCode($data['payer']['address']['country_code']);\n\n $this->getStateMachine()->apply($order, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_ADDRESS);\n }\n\n $order->setShippingAddress(clone $address);\n $order->setBillingAddress(clone $address);\n\n $this->getStateMachine()->apply($order, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_SELECT_PAYMENT);\n\n $this->orderManager->flush();\n\n try {\n $this->verify($payment, $data);\n } catch (\\Exception) {\n $this->paymentStateManager->cancel($payment);\n\n return new JsonResponse(['orderID' => $order->getId()]);\n }\n\n $this->paymentStateManager->create($payment);\n $this->paymentStateManager->process($payment);\n\n return new JsonResponse(['orderID' => $order->getId()]);\n }\n\n private function getOrderCustomer(array $customerData): CustomerInterface\n {\n /** @var CustomerInterface|null $existingCustomer */\n $existingCustomer = $this->customerRepository->findOneBy(['email' => $customerData['email_address']]);\n if ($existingCustomer !== null) {\n return $existingCustomer;\n }\n\n /** @var CustomerInterface $customer */\n $customer = $this->customerFactory->createNew();\n $customer->setEmail($customerData['email_address']);\n $customer->setFirstName($customerData['name']['given_name']);\n $customer->setLastName($customerData['name']['surname']);\n\n return $customer;\n }\n\n private function getOrderDetails(string $id, PaymentInterface $payment): array\n {\n /** @var PaymentMethodInterface $paymentMethod */\n $paymentMethod = $payment->getMethod();\n $token = $this->authorizeClientApi->authorize($paymentMethod);\n\n return $this->orderDetailsApi->get($token, $id);\n }\n\n private function getStateMachine(): StateMachineInterface\n {\n if ($this->stateMachineFactory instanceof StateMachineFactoryInterface) {\n return new WinzouStateMachineAdapter($this->stateMachineFactory);\n }\n\n return $this->stateMachineFactory;\n }\n\n private function verify(PaymentInterface $payment, array $paypalOrderDetails): void\n {\n $totalAmount = $this->getTotalPaymentAmountFromPaypal($paypalOrderDetails);\n\n if ($payment->getAmount() !== $totalAmount) {\n throw new \\Exception();\n }\n }\n\n private function getTotalPaymentAmountFromPaypal(array $paypalOrderDetails): int\n {\n if (!isset($paypalOrderDetails['purchase_units']) || !is_array($paypalOrderDetails['purchase_units'])) {\n return 0;\n }\n\n $totalAmount = 0;\n\n foreach ($paypalOrderDetails['purchase_units'] as $unit) {\n $stringAmount = $unit['amount']['value'] ?? '0';\n\n $totalAmount += (int) ($stringAmount * 100);\n }\n\n return $totalAmount;\n }\n}\n```\n\nAlso there is a need to overwrite `CompletePayPalOrderFromPaymentPageAction` with modified logic:\n\n```php\n<?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Controller;\n\nuse Doctrine\\Persistence\\ObjectManager;\nuse SM\\Factory\\FactoryInterface;\nuse Sylius\\Abstraction\\StateMachine\\StateMachineInterface;\nuse Sylius\\Abstraction\\StateMachine\\WinzouStateMachineAdapter;\nuse Sylius\\Component\\Core\\Model\\PaymentInterface;\nuse Sylius\\Component\\Core\\OrderCheckoutTransitions;\nuse Sylius\\Component\\Order\\Processor\\OrderProcessorInterface;\nuse Sylius\\PayPalPlugin\\Exception\\PaymentAmountMismatchException;\nuse Sylius\\PayPalPlugin\\Manager\\PaymentStateManagerInterface;\nuse Sylius\\PayPalPlugin\\Provider\\OrderProviderInterface;\nuse Sylius\\PayPalPlugin\\Verifier\\PaymentAmountVerifierInterface;\nuse Symfony\\Component\\HttpFoundation\\JsonResponse;\nuse Symfony\\Component\\HttpFoundation\\Request;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\n\nfinal class CompletePayPalOrderFromPaymentPageAction\n{\n public function __construct(\n private readonly PaymentStateManagerInterface $paymentStateManager,\n private readonly UrlGeneratorInterface $router,\n private readonly OrderProviderInterface $orderProvider,\n private readonly FactoryInterface|StateMachineInterface $stateMachine,\n private readonly ObjectManager $orderManager,\n private readonly OrderProcessorInterface $orderProcessor,\n ) {\n }\n\n public function __invoke(Request $request): Response\n {\n $orderId = $request->attributes->getInt('id');\n\n $order = $this->orderProvider->provideOrderById($orderId);\n /** @var PaymentInterface $payment */\n $payment = $order->getLastPayment(PaymentInterface::STATE_PROCESSING);\n\n try {\n $this->verify($payment);\n } catch (\\Exception) {\n $this->paymentStateManager->cancel($payment);\n $order->removePayment($payment);\n\n $this->orderProcessor->process($order);\n\n return new JsonResponse([\n 'return_url' => $this->router->generate('sylius_shop_checkout_complete', [], UrlGeneratorInterface::ABSOLUTE_URL),\n ]);\n }\n\n $this->paymentStateManager->complete($payment);\n\n $this->getStateMachine()->apply($order, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_SELECT_PAYMENT);\n $this->getStateMachine()->apply($order, OrderCheckoutTransitions::GRAPH, OrderCheckoutTransitions::TRANSITION_COMPLETE);\n\n $this->orderManager->flush();\n\n $request->getSession()->set('sylius_order_id', $order->getId());\n\n return new JsonResponse([\n 'return_url' => $this->router->generate('sylius_shop_order_thank_you', [], UrlGeneratorInterface::ABSOLUTE_URL),\n ]);\n }\n\n private function getStateMachine(): StateMachineInterface\n {\n if ($this->stateMachine instanceof FactoryInterface) {\n return new WinzouStateMachineAdapter($this->stateMachine);\n }\n\n return $this->stateMachine;\n }\n\n private function verify(PaymentInterface $payment): void\n {\n $totalAmount = $this->getTotalPaymentAmountFromPaypal($payment);\n\n if ($payment->getOrder()->getTotal() !== $totalAmount) {\n throw new \\Exception();\n }\n }\n\n private function getTotalPaymentAmountFromPaypal(PaymentInterface $payment): int\n {\n $details = $payment->getDetails();\n\n return $details['payment_amount'] ?? 0;\n }\n}\n```\n\nAnd to overwrite `CaptureAction` with modified logic:\n\n```php\n<?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Payum\\Action;\n\nuse Payum\\Core\\Action\\ActionInterface;\nuse Payum\\Core\\Exception\\RequestNotSupportedException;\nuse Payum\\Core\\Request\\Capture;\nuse Sylius\\Component\\Core\\Model\\PaymentInterface;\nuse Sylius\\Component\\Core\\Model\\PaymentMethodInterface;\nuse Sylius\\PayPalPlugin\\Api\\CacheAuthorizeClientApiInterface;\nuse Sylius\\PayPalPlugin\\Api\\CreateOrderApiInterface;\nuse Sylius\\PayPalPlugin\\Payum\\Action\\StatusAction;\nuse Sylius\\PayPalPlugin\\Provider\\UuidProviderInterface;\n\nfinal class CaptureAction implements ActionInterface\n{\n public function __construct(\n private CacheAuthorizeClientApiInterface $authorizeClientApi,\n private CreateOrderApiInterface $createOrderApi,\n private UuidProviderInterface $uuidProvider,\n ) {\n }\n\n /** @param Capture $request */\n public function execute($request): void\n {\n RequestNotSupportedException::assertSupports($this, $request);\n\n /** @var PaymentInterface $payment */\n $payment = $request->getModel();\n /** @var PaymentMethodInterface $paymentMethod */\n $paymentMethod = $payment->getMethod();\n\n $token = $this->authorizeClientApi->authorize($paymentMethod);\n\n $referenceId = $this->uuidProvider->provide();\n $content = $this->createOrderApi->create($token, $payment, $referenceId);\n\n if ($content['status'] === 'CREATED') {\n $payment->setDetails([\n 'status' => StatusAction::STATUS_CAPTURED,\n 'paypal_order_id' => $content['id'],\n 'reference_id' => $referenceId,\n 'payment_amount' => $payment->getAmount(),\n ]);\n }\n }\n\n public function supports($request): bool\n {\n return\n $request instanceof Capture &&\n $request->getModel() instanceof PaymentInterface\n ;\n }\n}\n\n```\n\nAfter that, register services in the container when using PayPal 1.x:\n\n```yaml\nservices:\n App\\Controller\\ProcessPayPalOrderAction:\n class: App\\Controller\\ProcessPayPalOrderAction\n public: true\n arguments:\n - '@sylius.repository.customer'\n - '@sylius.factory.customer'\n - '@sylius.factory.address'\n - '@sylius.manager.order'\n - '@sylius_abstraction.state_machine'\n - '@Sylius\\PayPalPlugin\\Manager\\PaymentStateManagerInterface'\n - '@Sylius\\PayPalPlugin\\Api\\CacheAuthorizeClientApiInterface'\n - '@Sylius\\PayPalPlugin\\Api\\OrderDetailsApiInterface'\n - '@Sylius\\PayPalPlugin\\Provider\\OrderProviderInterface'\n\n Sylius\\PayPalPlugin\\Controller\\ProcessPayPalOrderAction:\n alias: App\\Controller\\ProcessPayPalOrderAction\n\n App\\Controller\\CompletePayPalOrderFromPaymentPageAction:\n class: App\\Controller\\CompletePayPalOrderFromPaymentPageAction\n public: true\n arguments:\n - '@Sylius\\PayPalPlugin\\Manager\\PaymentStateManagerInterface'\n - '@router'\n - '@Sylius\\PayPalPlugin\\Provider\\OrderProviderInterface'\n - '@sylius_abstraction.state_machine'\n - '@sylius.manager.order'\n - '@sylius.order_processing.order_processor'\n\n Sylius\\PayPalPlugin\\Controller\\CompletePayPalOrderFromPaymentPageAction:\n alias: App\\Controller\\CompletePayPalOrderFromPaymentPageAction\n\n Sylius\\PayPalPlugin\\Payum\\Action\\CaptureAction:\n class: App\\Payum\\Action\\CaptureAction\n public: true\n arguments:\n - '@Sylius\\PayPalPlugin\\Api\\CacheAuthorizeClientApiInterface'\n - '@Sylius\\PayPalPlugin\\Api\\CreateOrderApiInterface'\n - '@Sylius\\PayPalPlugin\\Provider\\UuidProviderInterface'\n tags:\n - { name: 'payum.action', factory: 'sylius.pay_pal', alias: 'payum.action.capture' }\n```\n\nor when using PayPal 2.x:\n\n```yaml\nservices:\n App\\Controller\\ProcessPayPalOrderAction:\n class: App\\Controller\\ProcessPayPalOrderAction\n public: true\n arguments:\n - '@sylius.repository.customer'\n - '@sylius.factory.customer'\n - '@sylius.factory.address'\n - '@sylius.manager.order'\n - '@sylius_abstraction.state_machine'\n - '@sylius_paypal.manager.payment_state'\n - '@sylius_paypal.api.cache_authorize_client'\n - '@sylius_paypal.api.order_details'\n - '@sylius_paypal.provider.order'\n\n sylius_paypal.controller.process_paypal_order:\n alias: App\\Controller\\ProcessPayPalOrderAction\n\n App\\Controller\\CompletePayPalOrderFromPaymentPageAction:\n class: App\\Controller\\CompletePayPalOrderFromPaymentPageAction\n public: true\n arguments:\n - '@sylius_paypal.manager.payment_state'\n - '@router'\n - '@sylius_paypal.provider.order'\n - '@sylius_abstraction.state_machine'\n - '@sylius.manager.order'\n - '@sylius.order_processing.order_processor'\n\n sylius_paypal.controller.complete_paypal_order_from_payment_page:\n alias: App\\Controller\\CompletePayPalOrderFromPaymentPageAction\n\n sylius_paypal.payum.action.capture:\n class: App\\Payum\\Action\\CaptureAction\n public: true\n arguments:\n - '@sylius_paypal.api.cache_authorize_client'\n - '@sylius_paypal.api.create_order'\n - '@sylius_paypal.provider.uuid'\n tags:\n - { name: 'payum.action', factory: 'sylius.paypal', alias: 'payum.action.capture' }\n```\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues)\n* Email us at security@sylius.com",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "sylius/paypal-plugin"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.6.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sylius/paypal-plugin"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.7.0"
}, {
"fixed" : "1.7.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sylius/paypal-plugin"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Sylius/PayPalPlugin/security/advisories/GHSA-pqq3-q84h-pj6x"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-29788"
}, {
"type" : "WEB",
"url" : "https://github.com/Sylius/PayPalPlugin/commit/31e71b0457e5d887a6c19f8cfabb8b16125ec406"
}, {
"type" : "WEB",
"url" : "https://github.com/Sylius/PayPalPlugin/commit/8a81258f965b7860d4bccb52942e4c5b53e6774d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Sylius/PayPalPlugin"
}, {
"type" : "WEB",
"url" : "https://github.com/Sylius/PayPalPlugin/releases/tag/v1.6.1"
}, {
"type" : "WEB",
"url" : "https://github.com/Sylius/PayPalPlugin/releases/tag/v1.7.1"
}, {
"type" : "WEB",
"url" : "https://github.com/Sylius/PayPalPlugin/releases/tag/v2.0.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-472" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-03-17T21:26:50Z",
"nvd_published_at" : "2025-03-17T14:15:22Z"
}
}