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

Allowed taints to pass through urlencode() #8848

Merged
merged 1 commit into from
Dec 6, 2022
Merged

Conversation

mmcev106
Copy link
Collaborator

@mmcev106 mmcev106 commented Dec 5, 2022

The urlencode() function currently escapes all taints. I suspect it should only escape html & has_quotes taints. Here's an example where a taint should likely be reported, but is not:

https://psalm.dev/r/4c72d132a4

This PR attempts to fix this. Don't hesitate to let me know if I'm missing anything, or if you have any concerns.

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/4c72d132a4
<?php // --taint-analysis
system(urlencode($_GET['a']));
Psalm output (using commit 1cd10c3):

No issues!

@weirdan weirdan added the release:fix The PR will be included in 'Fixes' section of the release notes label Dec 6, 2022
@weirdan weirdan merged commit 4dc969b into vimeo:master Dec 6, 2022
@weirdan
Copy link
Collaborator

weirdan commented Dec 6, 2022

Thanks!

@mmcev106 mmcev106 deleted the urlencode branch December 28, 2022 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants