Skip to content
RCE Write-up Intermediate

Serverless, Not Senseless: How I Exploited Cloud Functions to Pe

Unauthenticated cloud function endpoints exposed user data, executed arbitrary commands, and allowed SSRF and database export. An attacker could list user emails, run commands on the server, access internal resources, and download a full database dump.

iski Follow

Published on infosecwriteups.com

Free Link 🎈

Iski, on infosecwriteups.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 cloud functions lacked authentication and input validation, and a debug endpoint executed arbitrary commands.

Impact

An attacker could exfiltrate the full database, execute arbitrary commands, and access internal resources via SSRF, exposing user data and secrets.

What the attacker needed

None

The fix

The functions should be fixed by requiring authentication or signed URLs, disabling debug endpoints, sanitising command inputs, and restricting access to temporary files.

How it was found

  1. Run subdomain enumeration and HTTP probing to find alive hosts.
  2. Notice a subdomain returning 403 normally but 200 with a query parameter.
  3. Use a directory scanner with serverless-specific wordlists to discover function endpoints.
  4. Visit the listUsers endpoint with a format parameter to get a JSON dump of user emails.
  5. Send a POST request with a command parameter to the debugMode endpoint and observe command output.
  6. Request the exportDB endpoint with a type parameter, then access the returned temp file path to download the database dump.

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.

Cloud functions are small pieces of code that run on demand. Here, they were left open to anyone without a login check, so a stranger could ask them to list users, run system commands, or export the database. This is like leaving a service window unlocked and unattended.

What is RCE?

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

More by iski

View all

186 more disclosed reports, best first.

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.