The Fix That Isn't — Review Output Handling Patches
After a security report, a team patched every place where their app uses a model reply. Six patches are waiting for review. Some close the hole. Others only look like they do, and would be bypassed within a day of shipping.
What is a false fix for output handling?
A false fix is a patch that looks like it closes a hole but leaves the dangerous path open. For model output, the common ones are removing a single tag, adding an instruction to the system prompt, and escaping only part of a value.
They pass review because each one does something visible. The test that matters is whether a reply shaped by an attacker can still reach the browser, database or shell in a form that gets interpreted.
A real case
We have not found a public incident from 2025 or 2026 that matches this technique closely enough to cite, so we are not listing one here.
How to fix it
- Sanitise rendered HTML with a maintained library instead of removing tags by pattern.
- Fix the code that consumes the reply. Do not rely on instructions to the model.
- Validate URLs against an allow-list of schemes before they reach an href.
- Escape every value for the place it is going: HTML body, attribute, SQL or shell each need their own handling.
Questions people ask
Why is a blocklist weak?
It only stops the patterns its author thought of. Allow-lists and proper encoders stop everything except what is known to be safe.
Should the system prompt still say not to output HTML?
It can help quality, but treat it as a preference. It must not be the only thing between a reply and a sensitive sink.
Read the full OWASP LLM Top 10 guide · All free labs · AI red team certification