AgentCore Harness Identity Credential Exfiltration and Replay
In Unit 42's controlled SupportCo test, instructions hidden in a support ticket made an agent run a script through AgentCore Harness's default shell. The script read PID 1 memory, sent the operator's MCP service-account JWT and server URL in one HTTP POST to a simulated attacker webhook, and the researchers replayed the JWT from a laptop to retrieve sample customer PII. The credential was not an end-user token. AWS treated this as shared-responsibility configuration guidance, not a patched service vulnerability.
Threat Analysis
AgentCore Identity protected the service credential at rest, but the Harness had to resolve it into plaintext at runtime. The default shell tool ran with the same root UID as the main process; an injected ticket therefore turned the shell into a reader of the process that held the credential.
- A hidden HTML comment in an inbound ticket told the agent to fetch and run an attacker-controlled script.
- The permissive test model used the built-in shell, enabled unless allowedTools was scoped at InvokeHarness.
- The shell read /proc/1/maps and readable regions of /proc/1/mem.
- The scan recovered the operator's MCP service-account JWT and downstream server URL, not the end user's token.
- The injected script sent both to a simulated attacker webhook in one HTTP POST.
- From a separate laptop, the researchers replayed the JWT, listed MCP tools and called lookup_customer to retrieve sample customer PII.
SupportCo was fictional and the test was controlled. AWS closed the disclosure as informational under shared responsibility and pointed to allowedTools and egress controls; this is not evidence of a real customer intrusion.
Applicable AIDEFEND Defenses (6)
What Defenders Should Do Now
- Derive allowedTools from each verified InvokeHarness task and configure a synchronous before_tool_call Lambda hook to deny shell and file_operations for support-answer work. Test denial on hook failure.
- Limit MCP token scopes and verify issuer, resource, audience, expiry and scope at the resource server. After exposure, enforce per-request revocation or independent service-access fencing and probe with the old token. Vault credential rotation alone does not invalidate an existing JWT.
- Run required commands in a separate environment containing no Harness credentials. Where customer-controlled routing exists, also enforce outbound destination restrictions and verify both boundaries independently.
1 additional consideration
Evidence and deployment boundary
Conclusion
Last updated: