escaping
Rewriting special characters in a value so an interpreter reads them as plain text, for example turning < into < in HTML.
In more detail
Escaping is the last-resort injection defence, after parameters and allowlists. Use only the escaping function that ships with the interpreter, because rules differ by context and hand-written versions are subtly wrong.
Related terms
- output encoding — Converting data into a safe form for the exact place it is written, such as HTML text or an attribute, so the browser shows it instead of running it.
- injection — A bug where untrusted data reaches an interpreter and part of it is read as code instead of as a value.
Taught in
- Anatomy Of A Prompt — AI Engineering: LLM Apps, RAG & Agents
- Zero-Shot And Few-Shot — AI Engineering: LLM Apps, RAG & Agents
- Guardrails, Privacy And Governance — AI Engineering: LLM Apps, RAG & Agents
- Injection In All Its Forms — Application Security & Threat Modeling for Engineers
- Cross-Site Scripting — Application Security & Threat Modeling for Engineers
- Dynamic Scanning — Application Security & Threat Modeling for Engineers