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

Missing TaintedSql when calling mysqli::execute_query #11020

Closed
cgocast opened this issue Jun 21, 2024 · 1 comment · Fixed by #11021
Closed

Missing TaintedSql when calling mysqli::execute_query #11020

cgocast opened this issue Jun 21, 2024 · 1 comment · Fixed by #11021

Comments

@cgocast
Copy link
Contributor

cgocast commented Jun 21, 2024

The following code should trigger two TaintedSql issues : https://psalm.dev/r/f98b88f1aa

I'll write a PR that fixes this bug

Copy link

I found these snippets:

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

$userId = $_GET["user_id"];
$query = "delete from users where user_id = " . $userId;

$link = mysqli_connect("localhost", "my_user", "my_password", "world");
$result = mysqli_execute_query($link, $query);  // Should trigger a TaintedSql

$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
$result = $mysqli->execute_query($query);  // Should trigger a TaintedSql
Psalm output (using commit 16b24bd):

No issues!

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

Successfully merging a pull request may close this issue.

1 participant