Skip to content

Commit

Permalink
$expr->name is not prefixed with $ (vimeo#4554)
Browse files Browse the repository at this point in the history
The example as-is would currently not flag the following code:

```
	public function foo() {
		$foo = $bad_data;
		\shell_exec($foo);
        } 
```

Switching it to `bad_data` made it work.
  • Loading branch information
LukasReschke authored and danog committed Jan 29, 2021
1 parent 2f36824 commit 7079cff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/security_analysis/custom_taint_sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BadSqlTainter implements AfterExpressionAnalysisInterface
array &$file_replacements = []
) {
if ($expr instanceof PhpParser\Node\Expr\Variable
&& $expr->name === '$bad_data'
&& $expr->name === 'bad_data'
) {
$expr_type = $statements_source->getNodeTypeProvider()->getType($expr);

Expand Down

0 comments on commit 7079cff

Please sign in to comment.