ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 337 - SY0-601 discussion

Report
Export

While performing a threat-hunting exercise, a security analyst sees some unusual behavior occurring in an application when a user changes the display name. The security analyst decides to perform a static code analysis and receives the following pseudocode:

Which of the following attack types best describes the root cause of the unusual behavior?

A.
Server-side request forgery
Answers
A.
Server-side request forgery
B.
Improper error handling
Answers
B.
Improper error handling
C.
Buffer overflow
Answers
C.
Buffer overflow
D.
SQL injection
Answers
D.
SQL injection
Suggested answer: D

Explanation:

SQL injection is one of the most common web hacking techniques. SQL injection is the placement of malicious code in SQL statements, via web page input12. A SQL injection attack consists of insertion or “injection” of a SQL query via the input data from the client to the application. A successful SQL injection exploit can read sensitive data from the database, modify database data (Insert/Update/Delete), execute administration operations on the database (such as shutdown the DBMS), recover the content of a given file present on the DBMS file system and in some cases issue commands to the operating system3.

According to the pseudocode given in the question, the application takes a user input for display name and concatenates it with a SQL query to update the user’s profile. This is a vulnerable practice that allows an attacker to inject malicious SQL code into the query and execute it on the database. For example, an attacker could enter something like this as their display name:

John'; DROP TABLE users; --

This would result in the following SQL query being executed:

UPDATE profile SET displayname = 'John'; DROP TABLE users; --' WHERE userid = 1; The semicolon (;) terminates the original update statement and starts a new one that drops the users table. The double dash (–) comments out the rest of the query. This would cause a catastrophic loss of data for the application.

asked 02/10/2024
Tim Pass
38 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first