OhMyBug

input/serialization

Text escaped for the wrong context

#78rare20 sightingsfirst seen August 2026

What goes wrong

Data is inserted into a web page, a database query, a shell command or a template without escaping for that exact place — or is escaped for one context (page markup) and then used in another (a script string, a shell command), or expanded again after escaping. Quotes and tags become code: the classic injection or cross-site scripting.

Example

A customer's name is dropped into an email template as raw markup; a name containing an image tag with an error handler runs script in every recipient's mail client.

Not to be confused with

Only escaping at an output boundary; not newlines splitting a line-based record (Newline in text splits the record), and not a scanner misreading literal source text (Custom parser mistakes text for syntax).

Discovered by

Field notes · 6