CSRF forces an authenticated end-user to execute unwanted actions on a web application where they are currently authenticated. Exploitation Techniques
Set cookies to SameSite=Lax or Strict to prevent the browser from sending them with cross-site requests. 3. SQL Injection (SQLi)
| Vulnerability | The "Fix" Keyword | Core Lesson | | :--- | :--- | :--- | | | Encode | Never trust user input in output. | | CSRF | Tokenize | Verify the request originates from the legitimate site. | | SQLi | Parameterize | Separate code from data. | | Traversal | Sanitize | Validate input against a whitelist of allowed values. |
In part 2 , users can encounter "Reflected XSS" by manipulating search queries or "Stored XSS" by submitting malicious scripts in file uploads.
Treat all client-side data as completely untrusted. Store authorization states, privilege levels, and pricing data strictly within secure server-side databases or sessions.
Sample lab setup script using Docker (DVWA + ModSecurity + OWASP CRS).
Gruyere allows users to upload files, such as profile pictures. However, the application fails to validate the destination paths properly.