PhpWebGallery <= 1.7.2 (comments.php) SQL Injection Vulnerability
The comments.php script in PhpWebGallery does not properly sanitise the sort_by parameter, allowing an attacker to inject SQL queries into the back-end database.
karmainsecurity.com
Published on karmainsecurity.com
PhpWebGallery contains a flaw that may allow an attacker to carry out an SQL injection attack. The issue is due to the ‘comments.php’ script not properly sanitizing user-supplied input to the ‘sortby’ variable.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the sort_by parameter is concatenated into an SQL query without validation or parameterisation.
Impact
An attacker could inject or manipulate SQL queries in the back-end database, potentially exposing or changing stored data.
What the attacker needed
Access to comments.php
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
SQL injection is when a program puts user input directly into a database command without cleaning it first. Here, the sort_by value from the web request is used in a database query, so an attacker can change that value to make the database do something unintended, such as reveal or alter data.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.