// Challenge ยท Hack the Demo Shop

Break into a shop. Legally.

Duka Demo is a fake online shop with three classic security bugs, the same kinds I find in real penetration tests. Find all three flags. Hints are there if you get stuck.

๐Ÿšฉ 1 ยท SQL injection๐Ÿšฉ 2 ยท IDOR๐Ÿšฉ 3 ยท XSS

// Fully simulated in your browser. There's no real server, and nothing you type is run or sent.

Level 1

Get into the admin account

You don't know the admin's password. Watch the panel on the right: it shows the database command the shop builds from what you type.

๐Ÿ›’ Duka Demodemo-shop.local
Staff login
Tip: a normal test account exists: guest / guest123
// what the server runs

    ๐Ÿ”’ Solve level 1 to unlock

    Level 2

    Read someone else's order

    You're logged in as guest and can see your own order. Customers' names, phone numbers and addresses are supposed to be private.

    ๐Ÿ›’ Duka Demodemo-shop.local
    My orders
    demo-shop.local/account/orders/
    // what the server checks if (!session.loggedIn) return 401;
    order = db.orders.find(id);
    return order;

    Spot what's missing?

      ๐Ÿ”’ Solve level 2 to unlock

      Level 3

      Make every visitor's browser run your code

      Product reviews are shown to everyone who visits the page. The shop saves exactly what you write.

      ๐Ÿ›’ Duka Demodemo-shop.local
      Blender 1.5L ยท Reviews
      Reviews appear below for every visitor.
      • Nakato S.โ˜…โ˜…โ˜…โ˜…โ˜†

        Strong motor, a bit loud.

      // how reviews are displayed<p>{{ review.text }}</p> // printed as-is

        ๐Ÿ† All three flags captured.

        You just did what a penetration tester does. These three bugs are among the most common I find in real apps. Does yours have them?