Researchers Show Prompt Injection Can Expose AWS AgentCore Identity Credentials

· Original article ↗

Summary

Unit 42 researchers demonstrated that prompt injection could use AgentCore Harness’s default shell tool to read a plaintext service-account JWT from runtime memory, exfiltrate it, and replay it to access downstream customer data.

Key points

  • In the researchers’ test, AgentCore Harness’s shell and file_operations tools were enabled by default unless restricted with allowedTools.
  • A hidden instruction in a support ticket persuaded the agent to run a remote script through the shell tool.
  • The shell ran as root alongside the harness process, and researchers found they could read its memory through /proc.
  • Researchers extracted a JWT resolved from the AgentCore Identity vault and sent it, with the MCP server URL, to a simulated attacker endpoint.
  • They replayed the token from outside AWS to call the MCP server and retrieve customer PII in their test environment.
  • AWS closed the report as informative under its shared responsibility model, citing allowedTools scoping and egress filtering as customer-side controls.
  • Unit 42 recommends restricting tools per session, applying least privilege to vault service accounts, and monitoring outbound traffic from harness containers.

Article Details

Attack Vectors
  • An indirect prompt injection hidden in an HTML comment in a support ticket instructed the agent to use the default shell tool to download and execute a recon script.
  • The shell tool ran as root and could read the harness runtime's /proc/1/mem; the researchers used it to find the plaintext JWT and MCP server URL in process memory.
  • The script sent the JWT and MCP server URL in an HTTP POST to a simulated attacker endpoint. The researchers then replayed the JWT against the MCP server to retrieve customer PII.
Defensive Notes
  • Restrict allowedTools at InvokeHarness time to the tools each session needs; the built-in shell and file_operations tools are enabled by default.
  • Apply least privilege to AgentCore Identity service accounts for their downstream integrations.
  • Monitor outbound traffic from harness containers and investigate endpoints outside the expected downstream integration list.
  • Isolate the shell from processes that resolve credentials, or otherwise prevent shell access to runtime credential memory.
  • AWS closed the reported finding as informative under the AgentCore shared responsibility model, citing allowedTools scoping and egress filtering as customer-side controls.

MITRE ATT&CK

Vendors

Products

Related Articles