The common vulnerability classes in web applications and APIs, such as injection, XSS, CSRF, broken access control and SSRF, how each one works, and how to prevent it in code and in your build pipeline.
You’re reading a free preview. Sign up to see every topic and question — and to play this deck as games.
How untrusted input ends up being run as part of a SQL query, a shell command or a template, and the coding habits that stop it.
37 total questions
Card #1
Injection (general idea)
Card #2
SQL injection
Card #3
Parameterised query (prepared statement)
1. A search endpoint builds its SQL by concatenating the search term, after replacing each single quote with two. A reviewer still flags it. What is the right fix?
2. An API lets clients choose the sort column with ?sort=name. Binding the column name as a query parameter fails. What should the code do instead?
3. Which of these does NOT prevent SQL injection?
1. In Java JDBC, use a ___ instead of a plain Statement so values are bound with methods such as setString.
Hint: The class name starts with Prepared.
2. With Python's subprocess module, keep shell=___ (the default) and pass the command as a list.
Hint: A Boolean value.
3. In the CWE catalogue, SQL injection is entry CWE-___.
Hint: A two-digit number in the 80s.