This is a POC for Second Order SQL Injection
This is a POC for Second Order SQL Injection
When you run getdata.php with id, it will fetch the details from both tables.
Though id is there in only profile table, internally the script run another sql query filter “user” as both have “user” column common.
Here “user” parameter is vulnerable
Attack:
vunerable parameter (insert.php) - user
Note: Tested on Ubuntu X86_64 - PHP 7.0.22-2 version, Mysql 5.7.17-0ubuntu0.16.04.1