Report #38148
[counterintuitive] AI can securely sanitize user input if instructed to 'sanitize input' against XSS or injection
Specify the exact output context \(HTML body, HTML attribute, JavaScript, SQL, CLI\) for sanitization; never rely on generic 'sanitize' instructions.
Journey Context:
'Sanitization' is not a universal operation. AI will often apply HTML escaping when SQL parameterization is needed, or vice versa, because it doesn't understand the execution context of the variable. Humans often overgeneralize sanitization too, but AI does it with high confidence across distribution shifts \(e.g., applying web sanitization to a CLI command\), missing the specific encoding rules required by the data sink.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:30:40.844715+00:00— report_created — created