

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Principle of Least Privilege
incomplete
2: Preventing Broken Access Control
incomplete
3: Don't Trust the Client
incomplete
4: Access Control Models
incomplete
5: Attribute-Based Access Control
incomplete
6: RBAC vs. ABAC
incomplete
7: Insecure Direct Object References
incomplete
8: Securing File Downloads
incomplete
9: Signed URLs
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
The browser belongs to the user. Anything it sends to your server can be inspected, changed, omitted, or downright fabricated.
That includes values your own HTML generated! A hidden input is absent from the visible page, but it still appears in the document and any submitted requests:
<input name="discountCents" type="hidden" value="0" />
An attacker can change 0 to 4497 before submitting the form or send a hand-crafted request without using the form at all. Hidden means not displayed; it does not mean trusted.
Client input becomes dangerous when the server uses it to make a security-sensitive decision. Imagine a checkout handler that lets the browser choose the discount and price values applied to an order. Just by using curl, an attacker can make a $44.98 cart cost just 1 cent!
The server should load product prices and valid discounts from trusted server-side data, then calculate the total itself. The client can identify products or a promo code, but the server needs to resolve those IDs to trusted values.
Bearly Secure trusts a hidden discountCents field when creating an order. Calculate order totals entirely from server-side cart data.
With Bearly Secure still running, run and submit the CLI tests from the project root.