How would you approach input handling with malicious and malformed input?
Answer
Start by building a shared payload library covering injection, XSS and encoding edge cases that gets run against every input field, rather than testing each field's validation logic from scratch. Focus on input handling with malicious and malformed input. Use 'output is always escaped regardless of what the input contained' as the oracle, since validation alone is not enough if a rejected-but-not-fully-escaped value can still reach a rendered page. Cover combined payloads (an input that carries both a SQL and an XSS pattern at once), not just single-technique cases, since combined payloads are what real crafted input looks like. Keep every payload and the raw response it produced logged so an escaping regression can be reproduced exactly. Release only when every input field escapes output correctly regardless of what malformed or malicious content was submitted.
Strong answer includes
- explicit risk and test oracle for input handling
- uses a shared payload library across every input field
- tests combined injection and XSS payloads, not single-technique cases
- measurable evidence and residual-risk statement
Practical example
A tester submitted a search field with a crafted string containing both a SQL wildcard and an XSS payload, and the application returned the raw, unescaped string back into the results page. The approach was to test every input field against a shared payload library covering injection, XSS and encoding edge cases, and to require that output is always escaped regardless of what the input contained.