Question: Task 3 : SQL Injection Attack on UPDATE Statement If a SQL injection vulnerability happens to an UPDATE statement, the damage will be more severe,

Task 3: SQL Injection Attack on UPDATE Statement
If a SQL injection vulnerability happens to an UPDATE statement, the damage will be more severe, because attackers can use the vulnerability to modify databases. In our Employee Management application, there is an Edit Profile page (Figure 2) that allows employees to update their profile information, including nickname, email, address, phone number, and password. To go to this page, employees need to login first.
When employees update their information through the Edit Profile page, the following SQL UPDATE query will be executed. The PHP code implemented in unsafe_edit.php file is used to update employees profile information. The PHP file is located in the /var/www/seedlabsqlinjection.com/public_html directory.
$conn = getDB();
$sql = "UPDATE credential SET nickname='$nickname', email='$email',
address='$address', phonenumber='$phonenumber', Password='$pwd'
WHERE id='$input_id'";
$conn->query($sql))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!