Modify the Login request and insert the Time based SQL query
(%27%2b((SELECT+1+FROM+(SELECT+SLEEP(25))A))%2b%27+%2f*+980
89e48-3a9f-4a56-a4c5-1b599701c710+*%2f) in the modified request
as shown.
I’ve responded to your private message. Please don’t disclose potential security issues on the public forum in the future; see the security document in the OJS GitHub repo.
Regards,
Alec Smecher
Public Knowledge Project Team
I ojs journal audited. SQL injection issue which is server response after sleep() function is applied in username.
Recommendation : White list Input validation, Use of Prepared Statements (with Parameterized
Queries), Use of Stored Procedures, Escaping All User Supplied Input. Reference : Note: Fix this issue throughout the application.
Payload Used:
%27%2b((SELECT+1+FROM+(SELECT+SLEEP(25))A))%2b%27+%2f*+9808
9e48-3a9f-4a56-a4c5-1b599701c710+*%2f
Reference (R2) : Modify the Login request and insert the Time based SQL query
(%27%2b((SELECT+1+FROM+(SELECT+SLEEP(25))A))%2b%27+%2f*+980
89e48-3a9f-4a56-a4c5-1b599701c710+*%2f) in the modified request
as shown.
OJS 3.1.x is no longer supported. However, I have attempted to replicate this locally on a 3.1.x installation and failed.
The OJS codebases uses either ADODB (older versions) or Laravel’s database toolset (newer versions) to manage database queries, and both provide tools for parameter binding to avoid SQL injections. In OJS 3.1.1, this is done for the login query and username parameter in lib/pkp/classes/user/PKPUserDAO.inc.php in the getByUsername function:
$result = $this->retrieve(
'SELECT * FROM users WHERE username = ?' . ($allowDisabled?'':' AND disabled = 0'),
array($username)
);
The $username parameter is bound to the query using ADODB’s toolset, not with string concatenation, so it should be protected against SQL injections.
I suspect the installation you’ve noted has been modified somehow to use unsafe string concatenations.
Regards,
Alec Smecher
Public Knowledge Project Team
That’s not related to the topic of this thread (time-based SQL injection); to help keep the forum organized, could you post other subjects as new topics?
Thanks,
Alec Smecher
Public Knowledge Project Team