Courseiva
Web Application and Injection AttacksmediumMultiple ChoiceObjective-mapped

CEH Web Application and Injection Attacks Practice Question

A web application allows users to upload profile images. An attacker uploads a file named 'image.php.png' with malicious PHP code, and the server executes it as PHP. Which type of vulnerability is this?

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

Unrestricted file upload vulnerabilities allow attackers to upload executable files if the server does not validate the file type or execute permissions.

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, also known as path traversal, exploits vulnerabilities where an application constructs file paths from user input without proper sanitization. This allows an attacker to access or manipulate files and directories stored outside the intended root directory by injecting characters like `../` into the path. While it involves file system interaction, the core issue in the question is the *upload* of a new, potentially malicious file, rather than *accessing* existing files through path manipulation.

  • Command injection

    Why it's wrong here

    Command injection occurs when an application passes unsanitized user-supplied data to a system shell, allowing an attacker to execute arbitrary operating system commands. This typically involves injecting commands into arguments of system calls like `exec()` or `system()`. The scenario described, uploading a profile image, does not inherently involve direct execution of OS commands; the vulnerability is in the file upload mechanism itself, not in how user input is processed by a shell.

  • SQL injection

    Why it's wrong here

    SQL injection is a web security vulnerability that allows an attacker to interfere with the queries an application makes to its database. By inserting malicious SQL code into input fields, an attacker can manipulate database queries to bypass authentication, extract sensitive data, or modify database content. The act of uploading a profile image, as described, does not directly involve manipulating database queries; the vulnerability lies in the server's handling of the uploaded file, not its interaction with a database.

  • Unrestricted file upload

    Why this is correct

    Unrestricted file upload is the correct answer because it directly describes the vulnerability where a web application allows users to upload files without adequately validating their type, size, or content. This critical flaw enables an attacker to upload malicious files, such as web shells or scripts, to the server. Once uploaded, these files can often be executed by the web server, leading to severe consequences like remote code execution, server compromise, or defacement.

About these practice questions

This CEH question is part of Courseiva's 870-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CEH practice question is part of Courseiva's free EC-Council 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 CEH exam.