Question 400
A security monitoring shift documents this situation: An API accepts path components such as ../../private/keys and returns files outside its public directory. Which preventive control would most directly reduce recurrence of this same problem?
Explanation
Correct Answer
This addresses recurrence of the actual mechanism: Path traversal escapes intended file access boundaries using untrusted path segments. It is tied to the same activity and supports the expected result: Traversal test requests cannot retrieve files outside the allowed tree.
Incorrect Answers
This helps prevent another problem: A web portal passes a filename into a shell command; a semicolon in the field triggers an unexpected second process. The present recurring risk is different: Path traversal escapes intended file access boundaries using untrusted path segments.
This helps prevent another problem: A support page reflects a user-controlled search term into HTML without encoding, and an injected script runs in another user's browser. The present recurring risk is different: Path traversal escapes intended file access boundaries using untrusted path segments.
This helps prevent another problem: An internet-facing administrative portal exposes an obsolete debug endpoint even though no public use is intended. The present recurring risk is different: Path traversal escapes intended file access boundaries using untrusted path segments.