Injection (Web)

What Injection means

Injection happens when user-controlled input is treated as instructions instead of data. The input crosses a trust boundary and reaches an interpreter.

Interview one-liner: “Injection is untrusted input reaching an interpreter without proper separation. I first identify sinks, confirm execution context, then demonstrate minimal impact and recommend parameterization or contextual encoding.”

Injection categories

How to think about injection

Step What you analyze Why it matters
1. Input source Where user input enters the system Defines attacker control
2. Sink Interpreter / parser / executor Determines injection class
3. Context Query, template, URL, entity Controls exploitability
4. Defense Parameterization, encoding, allow-list Prevents recurrence
For interview preparation and