GCIH Web App Injection Attacks Practice Question
An incident handler is investigating a web application that allows users to upload profile pictures. The application stores uploaded files in a directory accessible via the web and uses the original filename without sanitization. An attacker uploads a file named `shell.php.jpg` containing PHP code. The server executes the file when accessed via its URL. Which vulnerability has been exploited?
⚠ Common exam trap
The trap here is focusing on the double extension as a bypass of a specific filter, when the root issue is the lack of proper file type validation and execution prevention.
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
✓
Unrestricted File Upload
The application allows an attacker to upload a file with a double extension and then executes it, resulting in remote code execution. This is an Unrestricted File Upload vulnerability. Mitigations include validating file types by content, not just extension, storing uploads outside the web root, and disabling script execution in upload directories. Incident responders should inspect upload logs and file system for malicious files.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Directory Traversal
Why it's wrong here
Directory traversal allows attackers to access files outside the web root using sequences like `../`. In this scenario, the attacker uploads a file to a web-accessible directory and executes it; there is no traversal to access unintended files. The vulnerability is in the upload handling, not in path traversal. Therefore, this option does not fit the described behavior.
- ✗
Local File Inclusion (LFI)
Why it's wrong here
LFI allows an attacker to include local files on the server, potentially executing code if they can upload a file and then include it. However, in this scenario, the file is directly executed via its URL, not through an inclusion vulnerability. The core issue is the unrestricted upload and execution, not an inclusion flaw. Therefore, LFI is not the primary vulnerability here.
- ✗
Remote File Inclusion (RFI)
Why it's wrong here
RFI occurs when an application includes a remote file, often via a URL parameter, leading to code execution. Here, the attacker uploads a file directly to the server rather than causing the server to fetch a remote file. The execution happens because the uploaded file is stored and then accessed, not because of an inclusion directive. Thus, RFI is not the correct classification.
- ✓
Unrestricted File Upload
Why this is correct
The application fails to validate the file type and allows a file with a double extension to be stored and executed. The attacker bypasses a naive check for `.jpg` by including `.php` before it. This is a classic Unrestricted File Upload vulnerability, leading to remote code execution. Incident handlers should treat this as a critical finding and review upload validation logic.
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.