How do injection, cross-site scripting and cross-site request forgery differ as test risks?
Answer
Injection makes untrusted data alter an interpreter command; XSS executes attacker-controlled content in a browser context; CSRF causes an authenticated browser to send an unwanted request. Their preconditions, evidence and controls differ.
Strong answer includes
- distinct execution contexts
- preconditions
- control-aware testing
Practical example
A tester confirms an app is safe from CSRF because it checks an anti-CSRF token, but still finds a stored XSS in a comment field that lets an attacker's script run in other users' browsers and silently submit authenticated requests on their behalf — showing that a fix for one class of risk says nothing about the others.