Web Application Security: Introduction and Scope
Most of what people do online passes through a web application: a bank page, a school portal, a shop, an API behind a phone app. Each one is a program that accepts text from strangers, decides who they are, and then reads or changes data on their behalf. Almost every serious web breach comes down to one of those three steps going wrong: the text was treated as code (injection, cross-site scripting), the program believed the wrong person (broken authentication, session theft), or it let a real user do something they were not entitled to (broken access control). This course takes each step apart, shows how it breaks on a toy target that the lesson builds itself, and then shows how the break is detected and fixed.
The survey course Cybersecurity already introduced SQL injection, XSS, CSRF and the OWASP Top 10. This course assumes you have read those pages and goes several levels deeper: blind and second-order injection, DOM sinks and Content Security Policy, JWT and OAuth flaws, SSRF, deserialization, race conditions and the tools a tester uses.
Before anything else: authorization and scope
This is an offensive-leaning course. You will learn how attackers find and use web vulnerabilities, because defenders and testers can't fix what they don't understand. That knowledge comes with a rule that has no exceptions:
Only test applications you own, or that you have written permission to test, and only within the agreed scope.
Sending an injection payload to someone else's login form is not "just looking": in most countries it is a crime even if nothing is damaged. Before you test anything outside this course, read the law lessons of Security Foundations:
- Authorization, Scope and Rules of Engagement: what a written authorization contains, scope, test windows, stop conditions.
- US Law: the CFAA, UK and EU Law and Vietnamese Law: what "unauthorised access" means where you live.
- Responsible Disclosure, Bug Bounties and security.txt: what to do when you find a bug in a site you use. A bug bounty's published policy is a scope document: read it, and stay inside it.
Practise on targets made for it: the course's own toy apps, and deliberately vulnerable apps such as OWASP Juice Shop or DVWA running in your isolated lab.
How this course keeps every attack harmless
The track's safety line applies to every lesson:
- Mechanism → detection → fix. No lesson ends at the attack. Each vulnerability is followed by how it shows up in logs, code review or tests, and by the fixed code running.
- Toy targets only. SQL injection runs against an in-memory SQLite database the example creates. XSS, CSP and DOM payloads run inside a sandboxed frame on this page that can't read the site, its cookies or your data. Server-side bugs (SSRF, path traversal, command injection, IDOR, upload) run in a sandbox session: a container with no network at all, where a tiny Python web server binds
127.0.0.1and serves only its own temporary directory. - No payloads for real sites. Tool transcripts (Burp Suite, ZAP, ffuf, sqlmap…) are labelled lab sessions against
juice.lab.testand the lab range10.10.0.0/24in an authorised lab. No real domain is ever a target.
The map
| Section | What you learn |
|---|---|
| HTTP and the browser | the message format, cookies and their attributes, the same-origin policy, CORS, CSP with nonces, security headers |
| Authentication and sessions | password login, MFA and TOTP, passkeys, session fixation, JWT built by hand and broken, OAuth 2.0 and OpenID Connect with PKCE through ExcelTAD's own sign-in, OAuth flaws |
| Injection | in-band, blind and second-order SQL injection, parameterised queries, command injection, NoSQL/LDAP/template injection, reflected, stored and DOM XSS, sanitisation |
| Access control and request forgery | IDOR/BOLA, function-level authorization, mass assignment, CSRF, SSRF, open redirects |
| Files and data | path traversal, file upload, XXE, insecure deserialization |
| APIs and advanced topics | the OWASP API Security Top 10 2023, rate limiting, GraphQL, WebSockets, business logic, race conditions, request smuggling and cache poisoning |
| Testing and tools | OWASP Top 10 2025, OWASP WSTG, DevTools, Burp Suite, ZAP, ffuf, Gobuster, Nikto, sqlmap, writing findings |
| Practice | exercises and the mini project: a vulnerable login app to break, fix, retest and report on |
How examples run here
```python runruns in your browser (Python 3.13 in WebAssembly) withsqlite3,hmac,hashlib,secretsandcryptography. Injection demos build their database in memory.```sql runruns SQLite on a fresh copy of the TAD Market sample shop for every run.```html runruns in a sandboxed iframe withoutallow-same-origin: it is a separate, opaque origin, so a script in it can't read this page, its storage or its cookies. That is where every XSS payload in this course lives.```bash runblocks are recorded sandbox sessions (no network, no root). Each starts its own toy server on127.0.0.1, talks to it withcurl, and stops it.
Here is the pattern every server-side lesson uses: a ten-line WSGI app from Python's standard library, bound to loopback, and curl as the client.
cat > app.py <<'PY'
from wsgiref.simple_server import make_server, WSGIRequestHandler
class Quiet(WSGIRequestHandler):
def log_message(self, *args):
pass
def app(environ, start_response):
body = f"hello from the toy app, you asked for {environ['PATH_INFO']}\n".encode()
start_response("200 OK", [("Content-Type", "text/plain; charset=utf-8")])
return [body]
make_server("127.0.0.1", 8000, app, handler_class=Quiet).serve_forever()
PY
python3 app.py &
for i in $(seq 50); do curl -s -o /dev/null http://127.0.0.1:8000/ && break; sleep 0.1; done
curl -s http://127.0.0.1:8000/lesson/intro
curl -s -o /dev/null -w 'status %{http_code}, %{size_download} bytes, from %{remote_ip}\n' http://127.0.0.1:8000/
kill %1hello from the toy app, you asked for /lesson/intro
status 200, 40 bytes, from 127.0.0.1
The server listens on 127.0.0.1 only, inside a container without a network interface to the outside, and the session ends by stopping it. Every later server-side demo follows the same shape: start the vulnerable version, show the bug, show what the log or a test sees, start the fixed version, show the same request failing.
What you should know first
Networking for Security covers TCP, DNS, TLS and cleartext HTTP on the wire; JavaScript and SQL are the languages of most examples; Programming for Security already showed string-built versus parameterised queries and DOM sinks, which this course builds on. The cryptography behind password hashing, signatures and TLS is in Applied Cryptography.
Start with How the Web's Trust Model Works.
Test yourself
You notice a login form on a public website that might be injectable. What may you do under this course's rules?
- Try a single quote to confirm, since it causes no damage
- Run sqlmap with a low request rate
- Nothing beyond normal use, unless you have written permission or a bug bounty policy that puts it in scope
- Test it from a VPN so it can't be traced
Why can an XSS payload in this course's html run frame not steal anything from the site?
- The payloads are fake and never execute
- The frame is sandboxed without allow-same-origin, so it is an opaque origin with no access to the page, its storage or cookies
- The browser blocks all JavaScript in iframes
- The site has no cookies
What does every vulnerability lesson in this course contain after the attack demo?
- A list of real sites that were affected
- How it is detected and how it is fixed, with the fixed code shown working
- A ready-to-use exploit for production systems
- Nothing: the demo is the lesson
The toy servers in the sandbox sessions bind 127.0.0.1. What does that guarantee?
- Only programs on the same machine (here: the same network-less container) can reach them
- The server uses TLS
- The server is fast
- Anyone on the Internet can test them safely