Skip to content
Opsfolk

Secure coding, topic 18 of 70

Injection

Injection happens when input is mixed into a command, so that data becomes code: SQL built by joining strings, a shell command with a file name in it, a template rendered from user text.

The fix is to keep data and code apart: parameterised queries or an ORM for SQL, argument lists instead of a shell for commands, and never eval on input. A static analyser finds most of the remaining cases.

On Opsfolk

Nothing of ours for this topic yet: an article is on its way.

Elsewhere

Your progress