A site stores uploaded files in a web-accessible folder. Which control BEST stops an uploaded web shell from running?
Show the answer
Correct answerD. Disable script execution in the upload directory
AWhy not this: Output encoding mitigates XSS; it does not affect whether the server runs an uploaded file.
BWhy not this: Lockouts slow brute-force logins; they do not control what runs from the upload folder.
CWhy not this: CSRF tokens stop forged cross-site requests; they do not stop an uploaded script from executing.
DWhy this is right: If scripts cannot execute in the folder, the uploaded web shell is served as plain data and never runs.
A web shell only works if the server executes the uploaded script. Disabling script execution in the upload directory leaves the file inert. Anti-CSRF tokens protect against forged requests and do nothing about an uploaded file being executed.