Skip to content
Leaked secrets Write-up Intermediate

Exposed and Ignored: How a JavaScript API Key Gave Me Full Cloud

A Google Maps API key was exposed in public JavaScript and had full access to Google Cloud Platform services. An attacker could access sensitive data, list buckets, and achieve blind remote code execution via a cloud function.

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, a cloud API key with excessive permissions was hardcoded in client-side JavaScript.

Impact

The exposed key gave full infrastructure access, including sensitive data and remote code execution.

What the attacker needed

Publicly accessible JavaScript file; API key with excessive permissions

The fix

Secrets should never be exposed in frontend code; use restricted API keys and rotate them if exposed.

How it was found

  1. Performed subdomain enumeration and crawled JavaScript files.
  2. Found a suspicious JavaScript file and inspected it.
  3. Extracted an exposed API key from the minified code.
  4. Validated the key using KeyHacks and gcloud commands.
  5. Explored cloud services and dumped data.
  6. Achieved blind RCE via a cloud function.

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.

A secret key meant to be private was left in a public file that anyone can read. This key allowed access to the company's cloud services, so an attacker could read data and even run commands on their servers.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by iski

View all

186 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.