Question 410
A profile-photo endpoint accepts any file extension and places uploads in a web-executable directory. An attacker uploads a server script and invokes it through a URL. What design flaw enabled execution?
Explanation
Correct Answer
The server failed to restrict content and storage execution context. Validating types and keeping uploads outside executable paths is essential.
Incorrect Answers
File permissions may expose data, but the scenario is server-side execution of an uploaded script. That requires unsafe content handling and an executable upload location.
CSRF defenses affect who can cause an upload; they do not explain why the server executes an uploaded script from a URL-accessible folder.
Browser script injection is distinct from uploading a script that the server later executes from a web-accessible directory. Unsafe upload checks combined with executable storage create the server-side code execution exposure.