injection

A bug where untrusted data reaches an interpreter and part of it is read as code instead of as a value.

An attacker who controls part of a command controls what the system does.

In more detail

The interpreter may be a database, a shell, a template engine, a browser or a directory server; the payload changes but the shape never does. Concatenating caller text into a command destroys the difference between code and data, so the fix is to keep data on a separate channel: parameters first, an allowlist where there is no parameter slot, and library escaping last.

Related terms

Taught in

References