Cosmic Components Co.

Chain multiple business logic bugs - coupon race conditions, negative quantities, and voucher farming - to climb from Rookie to Elite tier and unlock the flag.

Summary

The web shop can be broken by chaining several business logic bugs together: concurrent coupon application lets discounts stack, the SSD trade-in accepts a negative RAM quantity, voucher redemption can be raced for repeated credit, and the final GPU and PSU purchases only count for tier progression when the discounted item is bought alone. Using those flaws in sequence upgrades the account from Rookie to Elite and unlocks the flag page.

Solution

The challenge can be solved in 7 steps:

Step 1 - Start from a clean account and track the real balance

Create a fresh user, log in, and verify the account state on /account. A normal account starts with 100 BBD and Rookie tier. An important correction from the failed attempts is that BBD parsing must allow negative values with a pattern such as -?[\d.]+, otherwise a debt state is mistaken for a positive balance and later checkouts appear inconsistent.

Step 2 - Reach Silver with the coupon race on Quantum RAM

Add Quantum RAM Stick (product 1) to the cart and race the coupon endpoints with SPACESALE15 and NEWCUSTOMER10. Because coupon application is not synchronized, the two discounts can be stacked many times on the same cart. After enough concurrent coupon submissions, checkout succeeds at a near-zero price and the first tier promotion triggers, moving the account to Silver and awarding the loyalty reward.

Step 3 - Use the SSD trade-in bug to reach Gold

Build a cart with Neutrino SSD Drive (product 2) and Quantum RAM Stick (product 1) at quantity -1. The negative RAM quantity acts like a trade-in and subtracts 300 BBD from the 500 BBD SSD, producing a 200 BBD base total. Apply the stacked coupons again to reduce the price further, then checkout. This purchase upgrades the account to Gold and grants another 100 BBD reward.

Step 4 - Farm VC with voucher purchase and redemption races

Buy a small batch of Ion Starter Vouchers (product 6) so the BBD balance stays positive, then collect the voucher codes from /account. Each code can be sent concurrently to /redeem-voucher, and the race condition credits the same voucher multiple times before the backend marks it as used. Use the first profit to buy more vouchers, redeem them again, and repeat the loop until the account holds more than 9000 VC. The key lesson from the earlier failed run is to avoid overspending BBD on large voucher buys, because a negative BBD balance blocks later premium checkouts even when the cart total is almost zero.

Step 5 - Buy the Ion Processor Core for Platinum

Add Ion Processor Core (product 3) to the cart and checkout with payment_method=vc. The product costs 9000 VC and the cart exposes a "Pay with 9000 VC" option when an Ion item is present. After the order confirmation, the account is promoted to Platinum while the remaining BBD balance stays positive.

Step 6 - Stack coupons, then swap to the GPU alone for Diamond

The Nvidia 8090 Ti GPU (product 4) is the gate to Diamond, but the coupon widget only works reliably while RAM is in the cart. First stack a large discount on a RAM cart, then remove RAM and add the GPU so the almost-free total persists. One subtle pitfall showed up during testing: if RAM and GPU are checked out together, the order ledger records the purchase as RAM and the Diamond promotion does not trigger. The fix is to perform the final discounted checkout with the GPU alone. With that swap, the GPU purchase is accepted for roughly zero BBD and the account reaches Diamond.

Step 7 - Repeat the stack-and-swap trick on the PSU and read the flag

Once Diamond is unlocked, Dark Matter PSU (product 5) becomes available. Repeat the same coupon-stacking method: build discount state on RAM, clear the cart, add only the PSU, and checkout at the reduced price. This final order promotes the account to Elite. After that, open /flag and the application returns the flag.