Skip to content
Preptima
mediumConceptMidSeniorStaff

You are told the application is safe from injection because all user input is escaped as it comes in. What is wrong with that?

5 min readUpdated 2026-08-15Target archetype: Big Tech, Enterprise Captive, Product Startup

Answer

Short answer

Escaping is meaningless without a destination, and at the point input arrives you do not know which parser will consume it.Injection is a property of the sink, so the defence belongs at each sink — bound parameters, an argument vector rather than a shell string, encoding chosen by output context — not at the edge.

Was this answer helpful?

Likely follow-ups

  • How would you enumerate every sink in an existing codebase, and which ones would you expect to be missed?
  • Why does a bound parameter remain safe when the value contains a quote and a semicolon?
  • Where do you enforce an allow-list for a sort column, and what does getting it wrong look like?
  • What must normalisation do before validation runs, and what breaks if the order is reversed?

Related questions

Further reading