How to fix: Client-Computed Price Sent Directly to Checkout Endpoint
A checkout/payment/order request sends an amount/total/price field whose value is read directly from a client-side variable rather than being recomputed server-side.
Why it matters
A user can modify the client-side total (via devtools, a proxy, or by editing the request directly) before it reaches the payment endpoint, paying an arbitrary, attacker-chosen amount for an order.
This is one of the most common business-logic flaws in quickly-scaffolded checkout flows: the cart total is computed in the browser for display, and that same computed value is trusted and forwarded as the amount to charge, instead of the server recomputing it from the authoritative cart/product data.
How to fix it
- 1Recompute the order total server-side from trusted product/price data on every checkout request; never trust a client-supplied amount.
- 2If a client-side total is sent for display/confirmation purposes, explicitly ignore it when creating the actual charge.
- 3Add an integration test that tampers with the client-sent amount and asserts the charged amount is unaffected.
Code examples
Recompute the total server-side
// Ignore any amount sent by the client
const cart = await getCartFromDb(userId);
const total = cart.items.reduce((sum, i) => sum + i.product.priceCents * i.qty, 0);
await charge({ amountCents: total });References
Detected automatically by VulnRadar. The check id is vibe-client-controlled-price, stable across every scan so you can filter or diff on it.
More ai code checks
- LowGeneric Error Messages Leak No Context
- MediumTODO/FIXME Security Note in Response
- Higheval() Usage in Page Scripts
- HighSSL Certificate Verification Disabled
- HighMath.random() Used for Security Tokens
- CriticalHardcoded Credential in Authentication Logic
- CriticalJWT 'none' Algorithm Accepted
- CriticalSQL String Concatenation Pattern Detected
Questions
- How severe is Client-Computed Price Sent Directly to Checkout Endpoint?
- VulnRadar rates this high severity in the ai code category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id vibe-client-controlled-price, which stays the same between runs so you can filter, diff, or gate CI on it.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.