GCIH Web App API Attacks Practice Question
A security analyst is reviewing logs from a web application firewall (WAF) and notices a series of requests containing payloads like ' OR 1=1 --' and 'UNION SELECT username, password FROM users'. These requests are targeting the login endpoint. Which type of attack is being attempted?
⚠ Common exam trap
The trap here is misclassifying SQL injection as command injection because both are injection attacks, but the payload syntax clearly indicates SQL.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
SQL Injection (SQLi)
The payloads contain SQL keywords and syntax designed to alter database queries, such as bypassing authentication or extracting data via UNION. This is characteristic of SQL injection. The other options represent different attack categories: XSS targets client-side scripts, command injection targets OS commands, and CSRF targets user browsers. The evidence clearly points to SQL injection.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Cross-Site Request Forgery (CSRF)
Why it's wrong here
CSRF tricks a victim's browser into making unintended requests to a web application where the victim is authenticated. The payloads here are directly attempting to manipulate database queries, not forge requests from a victim. CSRF does not involve injecting SQL syntax into input fields. Therefore, this option is incorrect for the described attack.
- ✗
Cross-Site Scripting (XSS)
Why it's wrong here
XSS involves injecting client-side scripts into web pages viewed by other users. The payloads shown are SQL syntax, not JavaScript or HTML. XSS would typically include <script> tags or event handlers. The goal of XSS is to execute code in a victim's browser, whereas these payloads aim to manipulate database queries. Therefore, this option does not match the observed attack.
- ✓
SQL Injection (SQLi)
Why this is correct
The payloads ' OR 1=1 --' and 'UNION SELECT ...' are classic SQL injection attempts. They aim to alter the logic of SQL queries to bypass authentication or extract data. The login endpoint is a common target for such attacks. This matches the observed behavior, making SQL injection the correct classification. The other options describe different attack types that do not involve SQL syntax.
- ✗
Command Injection
Why it's wrong here
Command injection involves executing arbitrary operating system commands on the server. The payloads shown are SQL statements, not shell commands like '; cat /etc/passwd'. While both are injection attacks, the syntax and target are different. Command injection would typically include system command separators and commands. Thus, this option is not correct for the given payloads.
Visual reference
About these practice questions
This GCIH question is part of Courseiva's 322-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official GIAC exam blueprint
This GCIH practice question is part of Courseiva's free GIAC certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the GCIH exam.