Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make taint analysis track foreach and argument unpacking? #3670

Closed
TysonAndre opened this issue Jun 24, 2020 · 1 comment
Closed

Make taint analysis track foreach and argument unpacking? #3670

TysonAndre opened this issue Jun 24, 2020 · 1 comment
Labels

Comments

@TysonAndre
Copy link
Contributor

See https://psalm.dev/r/191a7078ad

Expected: TaintedInput warnings for all 3 echo statements (possibly impractical to generalize for array keys)
Observed: No issues were emitted

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/191a7078ad
<?php // --taint-analysis

// $_GET can contain arrays, e.g. example.php?foo[keyinput]=input
foreach ($_GET['foo'] as $key => $arg) {
    echo $key;
    echo $arg;
}

function test(...$args) {
    echo $args[0];
}
// Argument unpacking (but not varargs) seems to cause issues
test(...$_GET['other']);
Psalm output (using commit de85e7c):

No issues!

@muglug muglug added the bug label Jun 24, 2020
muglug added a commit that referenced this issue Jun 24, 2020
@muglug muglug closed this as completed in dd25b81 Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants