Cloud Storage Misconfigurations
A company stores user files in an object bucket. The bucket is supposed to be private. A misconfiguration made it public — and once you know the bucket name, you can list every file in it, and read every file.
The rule: the app serves user files from a bucket at /api/29/bucket/. The bucket was supposed to be private. Your job is to list its contents and read the flag file.
Test
Copy these. Run them. Read what comes back.
Step 1 · Look at a legitimate file
The app exposes files by name. Start with one you already know exists.
curl -s "{LAB_API_BASE}/api/29/bucket/public/readme.txt"What you'll see:
Welcome to the bucket. Public files are here. Private files are in /private/ — but you can't see them.
The file told you something important: private files are stored at /private/. That was not supposed to be public information — but a well-meaning developer left it in a comment.
Step 2 · Try to list the bucket
Object stores often support listing a bucket's contents when the bucket is publicly readable. Try it.
curl -s "{LAB_API_BASE}/api/29/bucket/?list=1"What you'll see:
{
"objects": [
"public/readme.txt",
"public/logo.png",
"private/users.db.bak",
"private/flag.txt",
"private/audit.log"
]
}The bucket listed every file in it. The listing includes files under /private/ — the very files the readme said you couldn't see. The bucket's ListBucket permission is public. That is the misconfiguration.
Step 3 · Read a private file
Listing exposed the names. Reading them is even easier.
curl -s "{LAB_API_BASE}/api/29/bucket/private/flag.txt"What you'll see:
HL{cl0ud_buck3t_publ1c_list}The file returned. No auth. No key. The bucket was public — in both listing and reading. The developer intended one of those to be true, and accidentally set both.
Challenge
Now do it yourself. No copy-paste. Everything you need is above.
Listing has been fixed — /?list=1 now returns 403. But reading is still public if you know the filename. There is a backup file at private/users.db.bak.
Read it directly. It is a mock SQLite file. The flag is in a row called admin_token. Download the file, then use strings or sqlite3 to read it.
Solved.
You read files a public bucket was never supposed to expose. Read why it happened and how to prevent it — in Lesson 29.
Read Lesson 29 in the bookThis lab is free. The deep and the full knowledge is in the book. Full 30 Lessons
Lesson 29 — Cloud Storage Misconfigurations
You've practiced the exploit. Now learn why it happens, how attackers weaponize it, developer mistakes, how to fix it etc in the full Hunterlian book.
Buy the bookAlready have the book? Back to reader →