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

[FIX] SQL Level 5, variable should not be inside string single-quotes #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lacksfish
Copy link

Line 50
$query = "SELECT bookname,authorname FROM books WHERE number =".'$number';

in sql5.php will never work, as '$number' is a string.

Asuming this was an error, this PR fixes this issue.

@lacksfish
Copy link
Author

lacksfish commented Mar 11, 2022

I'm contemplating what that line should've looked like

Possible intentions could have been:

$query = "SELECT bookname,authorname FROM books WHERE number ="."'$number'";
or similarly
$query = "SELECT bookname,authorname FROM books WHERE number =".$number;

I've also thought about this possibility:
$query = "SELECT bookname,authorname FROM books WHERE number ='". $number . "'";

Either way, the current line is bugged, since it is taking $number as the literal string input each time.
The value from $_POST['number'] is never used as of now.

@JonasPertschy
Copy link

Thank you 👍🏻 I encountered the same issue. None of my static/dynamic scanners were able to spot the vulnerability because there is none. '$number' is not user-controlled data.

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 this pull request may close these issues.

2 participants