GCIH Web App Injection Attacks Practice Question
Exhibit
HTTP/1.1 200 OK
Content-Type: text/html
<html>
<form action="/search" method="GET">
<input type="text" name="q" value="' OR 1=1 --">
</form>
</html>Refer to the exhibit. An application reflects user input directly into the HTML value attribute. What type of vulnerability is present?
⚠ Common exam trap
Candidates often confuse Reflected XSS with Stored XSS or HTML injection, failing to realize that execution within an attribute context still qualifies as reflected cross-site scripting when immediately returned.
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
✓
Reflected Cross-Site Scripting (XSS)
The exhibit shows input being reflected back into the HTML attribute without proper sanitization. This is a classic example of Reflected Cross-Site Scripting (XSS). Because the input is rendered inside a tag attribute, an attacker can break out of the context using quotes to execute arbitrary JavaScript. This highlights the danger of rendering untrusted input, requiring rigorous encoding or validation strategies to ensure the browser interprets data as literal text.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
SQL Injection
Why it's wrong here
The exhibit displays a web page source code, not a database interaction. While the input payload looks like SQL, the vulnerability context is the browser's rendering of HTML. SQL injection occurs on the server side during database queries, whereas this is a client-side execution vulnerability occurring within the browser.
- ✓
Reflected Cross-Site Scripting (XSS)
Why this is correct
The application reflects the user-supplied query parameter 'q' directly into the HTML without sanitization. An attacker can inject a payload like '" onmouseover="alert(1)" to execute code. This vulnerability occurs because the server trusts input and fails to perform context-aware encoding before sending the response to the client browser.
- ✗
Command Injection
Why it's wrong here
Command injection occurs when user input is used to execute operating system commands on the server. The exhibit depicts HTML rendering, which is a presentation layer issue. There is no evidence of the input being passed to shell-level execution functions or backend system processes in this specific scenario.
- ✗
Insecure Direct Object Reference (IDOR)
Why it's wrong here
IDOR involves an attacker accessing resources by manipulating identifiers such as database keys. The exhibit shows a clear XSS vector where the application reflects user input. While both are web vulnerabilities, IDOR focuses on broken access control, whereas the exhibit highlights a failure in input-to-output data handling protocols.
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.