Injection Flaws
Untrusted input handed straight to a database or command, letting an attacker change what the query does.
Workshop 01 · Web Security
How web applications get broken: injection, broken authentication, and data left where anyone can read it. Learn what each flaw looks like and the defensive habit that stops it.
Web challenges cover the flaws that show up most often in real applications — the kind listed in the OWASP Top 10.
Untrusted input handed straight to a database or command, letting an attacker change what the query does.
Login and session handling that can be bypassed by editing a cookie, a token, or a request parameter.
Secrets left in page source, comments, backup files, or an API that returns more than it should.
Lesson 1 · WEB-01
Everything a website sends to your browser can be read by you: the HTML, its comments, the JavaScript, and any file sitting in the public web folder. Developers sometimes leave notes, test passwords, API keys, or backup files there, assuming nobody will look.
This falls under security misconfiguration in the OWASP Top 10: the application is not broken in its logic, it is simply deployed with things it should never have shipped.
Attackers start with the cheapest checks: view the page source, open the browser developer tools, and request files that sites expose by habit, such as robots.txt, .git/, or backup.zip. A robots.txt file asks search engines to skip paths, which also advertises exactly where the interesting files are.
<!-- TODO: remove before launch. Test account: admin / Winter2024! --> # robots.txt User-agent: * Disallow: /old-backups/
Lesson 2 · WEB-02
Authentication answers who are you?; authorization answers what may you do? Access control breaks when the application lets the user decide the second question, for example by reading their role from a cookie or a hidden form field the user can edit.
Broken access control is number one in the OWASP Top 10 (2021).
If a site stores role=guest in a plain cookie and shows the admin panel when it reads role=admin, anyone can open the browser’s storage inspector and change the value. The server never checks.
Cookie: session=7f3a...; role=guest // vulnerable server logic if (request.cookies.role === "admin") showAdminPanel();
Lesson 3 · WEB-03
Many applications build database queries from user input. If the input is pasted straight into the query text, the database cannot tell where the developer’s code ends and the user’s data begins, so a crafted input can change what the query does.
Below, the username is inserted between quotes. Input containing its own quote character closes the string early, and whatever follows is read as part of the SQL command, for example a condition that is always true, or a comment that removes the password check.
-- vulnerable: input pasted into the query text query = "SELECT * FROM users WHERE username = '" + username + "'" -- safe: a parameterized query keeps input as data query = "SELECT * FROM users WHERE username = ?" db.execute(query, [username])
Lesson 4 · WEB-04
An IDOR happens when an application fetches a record by an identifier the user supplies, such as an account number in a URL, without checking that this user is allowed to see that record. Being logged in is not the same as owning the data.
If your profile loads from an address ending in ?id=1001, an attacker simply tries 1000, 1002, and so on. When the server returns whatever it is asked for, every user’s record is one number away.
GET /api/profile?id=1001 → your profile GET /api/profile?id=1002 → someone else's profile (should be 403 Forbidden)
The point of the web track is not the exploit itself but the defensive habit behind it.
Client-side checks are for convenience. Anything that protects data has to be enforced where the user cannot edit it.
Prepared statements remove the ambiguity between code and data that injection depends on.
A valid session says who you are, not what you may open. Verify ownership on every object you return.
Comments, debug routes, and backup files in the web root are readable by anyone who looks.
Try the Web Security challenges: capture the flags, score points, and unlock the explanation for each one.