
The tester runs the following:
Which of the following is the best control to prevent abuse of the system?
Show answerHide answer
Correct answer: D Reducing the privilege scope of the service account
Explanation
Explanation:Reducing the privilege scope of the service account is the best control to prevent abuse of this system. The script demonstrates a command injection or privilege escalation vulnerability where the penetration tester is iterating through administrative commands—deleteBuckets, getObjects, listAcl, listPermissions—via the file_id parameter. The fact that these commands execute successfully (indicated by 200 responses and a count of 4) proves the service account running the AI application has excessive privileges far beyond what is required for its core function of searching and returning file contents. By applying the principle of least privilege, the administrator should restrict the service account to only the specific permissions needed—such as readObjects within a designated bucket—and explicitly deny administrative or destructive operations. This immediately neutralizes the attacker's ability to execute privileged commands, regardless of other vulnerabilities.
Why the other options are incorrect:
A. Custom detection rules for anomalous model behavior:
Detection rules would identify suspicious activity after it occurs, not prevent the abuse. The script's commands would still execute successfully, causing potential damage before any alert is triggered. Prevention is superior to detection.
B. Segmenting the workload into a separate VPC:
VPC segmentation is a network-level isolation control that limits lateral movement. However, it does not address the underlying issue—the service account itself has excessive permissions. The attacker could still execute privileged commands within the segmented environment.
C. Adding an LLM guardrails library to the application code:
LLM guardrails filter or validate inputs and outputs at the application layer. However, the vulnerability is not prompt injection—it is a direct API call with a crafted parameter. The script bypasses the LLM entirely and interacts directly with the backend filesystem or cloud storage API. Guardrails would not intercept this backend request.
References:
CompTIA SecAI+ CY0-001 Exam Objectives: Domain 3.1 (Securing AI Systems – Identity and Access Management, Least Privilege) and Domain 2.2 (Threats to AI Systems – Privilege Escalation).

