Learn how to secure networks, applications, and systems against digital threats.
Web applications are the most exposed software most organizations run: anyone on the internet can reach them. Web application security is about controlling that exposure — validating and encoding every input, protecting sessions and identities, and enforcing authorization on every request. This lesson covers the OWASP-style fundamentals: the attack surface, authentication and authorization, the major vulnerability classes (XSS, CSRF, SQL injection, IDOR, broken access control, misconfiguration, file upload, path traversal, SSRF), and the defensive controls that stop them. For each major vulnerability you will learn what it is, why it happens, what an attacker aims to achieve, a deliberately simplified toy example, the impact, and how to prevent and detect it. Everything is educational, local, and contained.
HTTP is stateless: each request is independent. Cookies and session tokens let a server remember a user across requests. That state is valuable to attackers, so it must be protected.
| Concept | Role | Risk if mishandled |
|---|---|---|
| Cookie | Stores state in the browser | Session hijacking if stolen or predictable |
| Session token | Identifies the logged-in user | Account takeover if leaked |
| Request/response | The channel of interaction | Tampering or injection via untrusted input |
XSS occurs when an application renders untrusted input as HTML or JavaScript, letting an attacker run script in a victim’s browser.
| Type | Where the payload lives | Typical trigger |
|---|---|---|
| Stored XSS | Persisted on the server (a comment, a profile) | Every visitor who views it |
| Reflected XSS | Echoed from the request (a search term) | A crafted link the victim clicks |
| DOM XSS | Processed by client-side JavaScript | Manipulating the page state |
CSRF tricks an authenticated user’s browser into making an unintended request to a site where they are logged in, riding on their existing session.
SQL injection occurs when user input is concatenated into a SQL query, letting an attacker alter the query’s meaning.
SSRF makes the server itself issue requests to an attacker-chosen URL. Because the request comes from the trusted server, it can reach internal systems such as metadata endpoints.
| Control | Purpose |
|---|---|
| HTTPS (TLS) | Confidentiality and integrity in transit |
| Content-Security-Policy | Restricts what scripts and resources may load |
| Strict-Transport-Security | Forces HTTPS |
| CORS policy | Controls which origins may read responses |
For every finding, reason about the whole chain: the weakness, how it is exploited, the harm it causes, how to prevent it, and how to detect it.
A search page echoes the query into HTML without encoding.
(encoding renders the input as text, not script)
The same login query written unsafely and safely.
(the parameterized query treats input as data, never as SQL)