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

Taint not found inside "if" statement #7950

Open
mmcev106 opened this issue May 11, 2022 · 6 comments
Open

Taint not found inside "if" statement #7950

mmcev106 opened this issue May 11, 2022 · 6 comments

Comments

@mmcev106
Copy link
Collaborator

Should this taint be reported?

https://psalm.dev/r/8c624220b8

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/8c624220b8
<?php // --taint-analysis

if(true){
	$a = $_GET['a'];
}

echo $a;
Psalm output (using commit f960d71):

No issues!

@AndrolGenhald
Copy link
Collaborator

Yes, but currently the type of $a is lost once the if scope ends. I have a branch I've done some work on to fix this, but I haven't had much time the past few months to finish it and get it working. Hopefully I'll have more time in a month or two, I'll add this as a test case to make sure it works.

@mmcev106
Copy link
Collaborator Author

Thanks for the info! I'm curious, which branch would that be?

@AndrolGenhald
Copy link
Collaborator

I think it's still local atm, it's failing a lot of tests and still needs quite a bit of work. I started working on loops and ifs after I got stuck on the same issue in #7688, since the variable not being defined outside of the if scope caused problems with my TryAnalyzer improvements.

@mmcev106
Copy link
Collaborator Author

mmcev106 commented Jul 3, 2023

@AndrolGenhald, any updates here? If not, would it make sense for that branch to be made public so that others might be able to help?

@orklah
Copy link
Collaborator

orklah commented Jul 3, 2023

The branch is here if anyone want to look at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants