Skip to content

MIR0800

TaintedInput

Tainted input reaches a parameter annotated @taint-sink <kind> where <kind> has no dedicated issue. The sink field names that kind. Built-in sinks and the named kinds (html, sql, shell, file, include, eval, unserialize, …) report their own issue, such as TaintedFile.

<?php
/** @taint-sink graphql $query */
function runQuery(string $query): void {}
runQuery($_GET['q']); // TaintedInput: Tainted input reaching sink 'graphql'

Validate or escape the value before it reaches the sink. If the value is already trusted, suppress with @mir-suppress TaintedInput.