Study Notebook / 05

Backend Security

Where you made an assumption, and who is going to find it

Every vulnerability is an assumption someone else found first. Injection across SQL, NoSQL and the shell, password storage done properly, sessions and tokens, and the boundaries where data turns into code.

pages
55
sections
35
editions
Reading, Print, Tablet

Sign in to read it

Sign in and the whole notebook opens, all three editions with it. An account is what makes a download belong to someone.

Sign in with GitHub or Google

Start reading

How to use this book

Start reading

What is inside

Every section, and every one of them opens in the browser. Nothing here is hidden: if a section you need is not in this list, the notebook is not the right one and you should not spend a week on it.

  1. How to use this book
  2. The whole book in one question
  3. 1Assumptions are the vulnerability
  4. 2Your application speaks several languages
  5. 3The boundary between data and code
  6. 4SQL injection
  7. 5Parameterised queries, and what they cannot do
  8. 6NoSQL injection
  9. 7Command injection
  10. 8The argument array
  11. 9Build it only if you have a reason
  12. 10Never store a password
  13. 11Why hashing alone is not enough
  14. 12Salt, and the right algorithm
  15. 13Sessions
  16. 14Cookie flags
  17. 15JWT: what you gain and what you give up
  18. 16Rate limiting
  19. 17The layer where the check belongs
  20. 18Broken object level authorization
  21. 19What the status code leaks
  22. 20Deny by default
  23. 21Audit logging
  24. 22Cross-site scripting
  25. 23Content Security Policy
  26. 24Cross-site request forgery
  27. 25Clickjacking
  28. 26Secrets
  29. 27Error messages and debug output
  30. 28What you must not log
  31. 29Dependencies
  32. 30Reviewing an endpoint
  33. 31Follow-up question bank
  34. Appendix A. The response headers
  35. Appendix B. Glossary
  36. Appendix C. Self-test

How to read it

Read with a pen. Every notebook opens with a question to answer before you start and asks you to redo the answer at the end, and the margin in the Print edition exists so you have somewhere to be wrong first. The Tablet edition is 16:9 with vector text, so note apps draw on it rather than treating it as a photograph.

more notebooks