Skip to content
Leaked secrets Write-up Beginner

From CSS to AWS: How a Stylesheet Reference Leaked Cloud Secrets

A CSS file contained AWS access keys in a comment, allowing an attacker to authenticate to AWS and access S3 buckets containing sensitive data.

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, developers left AWS credentials in a comment within a publicly accessible CSS file.

Impact

The leaked keys allowed unauthorised access to S3 buckets, exposing database backups, user PII, and internal access tokens, potentially leading to full infrastructure compromise.

What the attacker needed

Publicly accessible CSS file; AWS credentials embedded in the file

The fix

Credentials should never be stored in frontend files; use secrets management and least privilege IAM policies.

How it was found

  1. During reconnaissance, the hunter found a CSS file reference.
  2. The hunter opened the CSS file and found AWS keys in a comment.
  3. The hunter configured AWS CLI with the keys and ran get-caller-identity to verify.
  4. The hunter listed S3 buckets and downloaded contents from a bucket.

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 company's website had a CSS file (which controls how pages look) that accidentally included secret login keys for their Amazon cloud account. Anyone who found those keys could use them to access the company's cloud storage and download private files.

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.