System Design · Junior · Question 42 of 75
Why can't you trust data that comes from the client?
- ✓Correct answer: The user can modify any request the client sends
- 2The client always sends data in the wrong encoding
- 3The browser randomly alters data when sending it
Explanation
Via DevTools, curl or a proxy, anyone can send any values: a product price, someone else's ID, an admin role. The server must check permissions, validate input and recompute important values (an order total) itself.