Skip to content

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