A security engineer is analyzing HTTP request logs for a document generation microservice after a Security Information and Event Management (SIEM) alert triggered on high CPU utilization. The service accepts custom template strings from authenticated users to format PDF invoices. Inspection of an isolated POST request payload reveals the following body:
`{"account_id": 9402, "template_body": "{{ self._TemplateReference__context.namespace.__init__.__globals__['os'].popen('id').read() }}"}`
The microservice returned an HTTP 200 OK response containing the payload output: `uid=1001(appworker) gid=1001(appworker)`.
Which of the following vulnerabilities was exploited in this incident, and what primary software control best prevents this vulnerability?
- Server-Side Template Injection (SSTI); remediate by using a sandboxed rendering engine or avoiding reflection to native language globals during template evaluation.Answer
- BCross-Site Scripting (XSS); remediate by configuring HTTP-only flags on session cookies and enforcing strict Content Security Policy (CSP) headers.
- COS Command Injection; remediate by enforcing parameterized SQL database queries and input length restrictions on POST requests.
- DBroken Object Level Authorization (BOLA); remediate by implementing strict role-based access control (RBAC) checks on the endpoint.