Skip to content
KALANBLON
Show contents

Chapter 7 of 7 · 10 min

Quiz: securing a web application

SQL injection, XSS, validation, access control and auditing: let's check that you can secure a web application. You need 70% correct answers, and every answer is explained.

Quiz

7 questions · pass mark: 70%

  1. 1.Why is this code vulnerable?

    One answer

    db.execute(f"SELECT * FROM comptes WHERE nom = '{nom}'")
  2. 2.Complete the parameterised query.

    Complete the code

    db.execute("SELECT * FROM comptes WHERE nom = ___", (nom,))
  3. 3.What does “<b>Salut</b>” become after html.escape?

    One answer

  4. 4.Why is a blacklist that removes “<script>” not enough?

    One answer

  5. 5.Which protections limit the damage of an XSS? (several answers)

    Several answers possible

  6. 6.A member can delete someone else's comment by changing the id. What is the right fix?

    One answer

  7. 7.During an authorised audit, you find a SQL injection. What do you do?

    One answer

Your progress is saved on this device. Create a free account to keep your progress on all your devices.