Price or Quantity Manipulation
The application trusts prices, totals or quantities sent by the browser, so a buyer can change what they are charged or order negative or fractional quantities.
| Severity | High |
| CVSS 3.1 | 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N Open in the calculator |
| CVSS 4.0 | 8.7 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-472: External Control of Assumed-Immutable Web Parameter |
| OWASP Top 10 | A06:2025 Insecure Design |
| MITRE ATT&CK | T1190 Exploit Public-Facing Application, T1657 Financial Theft |
| Category | Insecure Design |
Description
The application takes the price, discount, total, currency or quantity of an order from values the client sends, such as hidden form fields, JSON properties, cookies or a basket held in the browser, and uses them to work out the amount charged, instead of looking up prices and recalculating totals on the server. Values that the interface never lets a user choose, such as a negative, zero, fractional or extremely large quantity, are also accepted.
An attacker can therefore buy goods or services for less than their price or for nothing, generate credit or refunds, or combine discounts beyond the intended limits. Negative quantities can reduce the total charged for other items in a basket or create credit, and very large values can overflow the numeric types used in calculations. The result is direct financial loss and possible fraud, which often goes unnoticed until orders are reconciled. Where guest checkout is offered no account is needed, and the attack can be repeated as often as the attacker likes.
The weakness is identified by intercepting the requests that add items to a basket, apply discounts, choose delivery options, check out and start payment, changing the price, quantity, currency and discount values, and checking the resulting order total, the amount passed to the payment provider and the confirmation. A related form appears in payment integrations where the amount travels through the user's browser to the payment provider and the application does not check, when payment is confirmed, that the amount and currency paid match the order total.
Remediation
Treat every price, total and quantity from the client as untrusted, and calculate charges on the server:
- Accept only product identifiers and quantities from the client, and take prices from the server's catalogue. Recalculate discounts, tax, delivery and the order total on the server whenever the basket changes and again at the point of order.
- Validate quantities as whole numbers within sensible minimum and maximum values and available stock, and reject zero, negative and fractional values. Use decimal types for money rather than floating point.
- Check discount codes on the server for eligibility, expiry, single use and combination rules, and never allow a line or order total below zero.
- Send the amount to the payment provider from the server, or in a request the provider can verify, and when payment is confirmed, verify the notification's authenticity and that the amount and currency paid match the order total before fulfilling the order.
As an interim measure, reconcile orders against catalogue prices and hold any whose totals do not match for review. Confirm the fix by repeating the tampered requests and checking that the server ignores client-supplied prices and rejects invalid quantities.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.