A string built at run time is run with eval
What it finds
eval($code) runs a string as PHP code. Whatever reaches the string can do anything the application can, the code escapes every tool that reads source, and almost every use has a plain alternative. A string literal is left alone.
From the rule's source, eval_call.rs.
<?phpfunction run($code){ eval($code);tx0 reports: a string built at run time is run as PHP code eval('return 1;');} Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/php:eval-call" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/php:eval-call] reason="..."tx0 explain tx0/php:eval-call shows the same in the terminal. Found a false positive? Report it.