Lion Cipher Lab

Exploit a weakly-configured PostgreSQL in your own lab, then lock it down

Why it matters

PostgreSQL is one of the most widely deployed databases in the world — it sits behind web apps, analytics stacks, and internal tools everywhere — and unlike a cache it holds the crown jewels: customer records, credentials, business data. It is also, unlike Memcached or a stock Redis, a database that authenticates by default: the official container will not even start without a password unless you deliberately tell it not to. That is exactly why the way it gets breached is instructive. Nobody ships Postgres with 'no authentication' as a documented default; instead, a real team under deadline…

What you'll learn

Steps in this lab

  1. What PostgreSQL is, and why an exposed superuser is worse than an exposed cache
  2. Build the isolated lab: two containers, one private network, your machine only
  3. Confirm the exposure — a superuser session with no password
  4. Read server-side files with pg_read_file() — and see why it needs superuser
  5. The headline: command execution with COPY ... FROM PROGRAM (in your own container)
  6. The fix, and the measurement: real auth, a locked-down listener, and a least-privilege role
  7. Do it better — recognise, report, and prevent the exposed database

Open the full interactive lab →