Title: Zero Stars
Category: Improper Input Validation
Difficulty: ⭐ (1/6)
This challenge involves giving a zero-star feedback rating to a store, exploiting improper input validation mechanisms. The challenge tests abilities to manipulate web forms and intercept network requests to alter data before submission.
- Web browser with developer tools
- Burp Suite (or any other suitable network interception tool)
To complete the "Zero Stars" challenge, two different methods were successfully employed:
- Setup Interception: Configured Burp Suite to intercept the HTTP requests sent from the browser using Proxy functionnality.
- Submit Review: Attempted to submit a review normally through the website's interface, capturing the outgoing request in Burp Suite.
- Modify the Request: Altered the
ratings
parameter in the intercepted request to0
, despite the website originally not allowing a zero-star rating to be submitted through its user interface.
- Forward the Request: Sent the modified request to the server, successfully submitting a zero-star review.
- Inspect Element: Used the browser's developer tools to inspect the review submission button and found it disabled when attempting to give a zero-star rating.
- Enable Submission Button: Manually removed the
disabled="true"
attribute from the HTML of the submit button using the developer tools, enabling the button.
- Submit the Form: With the modified button state, submitted the form. Since the rating defaults to
null
when no stars are selected, the system processed this as a zero-star review due to lack of proper server-side validation.
Both solutions exploit weaknesses in the application's handling of input validation:
- Method 1 bypasses the client-side restrictions by directly manipulating the HTTP request, demonstrating the need for robust server-side validation.
- Method 2 highlights a common oversight where client-side controls (like a disabled button) are relied upon for validation, without corresponding server-side checks.
To prevent such issues and secure the application against improper input validation:
- Implement Server-Side Validation: Ensure that all inputs, including ratings, are validated on the server side to prevent unauthorized values from being processed.
- Secure Client-Side Logic: Enhance client-side scripts to prevent easy tampering from the developer console. However, always assume that client-side controls can be bypassed.
- Use Proper Data Types: Ensure that the data type for ratings strictly accepts only valid ratings and does not default to accepting
null
or other unintended values as valid input.