Skip to content
RCE Write-up Intermediate

# Tôi Đã Hack Bankr Trong 6 Giờ. Đây Là Toàn Bộ Những Gì Tôi Tìm Thấy.

The AI agent behind Bankr's terminal mode executed arbitrary shell commands when prompted, allowing remote code execution on the backend sandbox. The attacker could also exfiltrate data and read production source code via a leaked source map, but the sandbox was hardened with zero secrets and minimal IAM permissions.

h4cktrick Follow

Published on medium.com

Sáu giờ sau, tôi đã đọc từng dòng mã nguồn production, thực thi lệnh tùy ý trên hạ tầng AWS Lambda của họ, và vẽ ra toàn bộ bản đồ kiến trúc bảo mật đến từng namespace level.

Van Thong, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the AI agent lacked proper input validation and command execution restrictions, allowing arbitrary shell commands to run in the sandbox.

Impact

An attacker could execute arbitrary commands and exfiltrate data from the sandbox, but the sandbox contained no secrets, credentials, or user funds, and network access was restricted.

What the attacker needed

A Bankr account; access to the terminal mode

The fix

The sandbox was rebuilt with a zero-secrets architecture and minimal IAM permissions, and source maps should be removed from production deployments.

How it was found

  1. Ask the agent to output its system configuration.
  2. Run a simple shell command to confirm execution.
  3. Use Node.js to send environment variables to an external webhook.
  4. List files in /var/task/ to find a source map.
  5. Extract the full TypeScript source code from the source map.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

An AI agent is a chatbot that can run tools and commands. Here, the agent ran any shell command a user typed, so the user could execute code on the company's server. The server was a sandbox (an isolated environment) with no valuable secrets, so the impact was limited.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.