Designing the Savvy Security CTF: Real-World Architecture, Deceptive Simplicity, and Anti-Cheat Mechanics
Most web security challenges rely on synthetic trivia or esoteric cryptography: decoding unaligned base64 strings hidden inside JPEG comments, reverse-engineering stripped x86 binaries, or exploiting arbitrary XOR ciphers. While intellectually entertaining, these exercises bear almost no resemblance to modern production security incidents.
In production cloud environments, catastrophic breaches rarely originate from raw buffer overflows or textbook SQL injections on hand-rolled queries. Instead, they stem from subtle business logic oversights: broken authorization checks, pricing calculations trusted from the client, unvalidated body merging, and exposed diagnostic interfaces.
As an extension to Roast My Portfolio, I designed and built Savvy 2.0, a full-fidelity enterprise hardware storefront that looks, feels, and operates like an authentic e-commerce store, but contains four interconnected real-world logic vulnerabilities.

1. The Design Philosophy: Deceptive Realism
The core objective of Savvy 2.0 was deceptive realism. If an engineer enters a sandbox expecting a traditional CTF, they immediately start running automated fuzzers against URL parameters or checking page source comments for hidden flags.
Savvy breaks this convention. There are no flags hidden in HTML comments, no artificial binary endpoints, and no exposed environment variables. The storefront has a functioning product catalog, a working reactive shopping cart, a mock checkout pipeline, and user account settings.
To find the vulnerabilities, candidates cannot rely on brute force. They must think like full-stack software engineers: inspect network payloads in browser DevTools, analyze how state flows between client requests and server endpoints, and evaluate whether the system enforces server-side authority.
2. Architecture & Threat Modeling: Edge Isolation Without Credential Risk
Opening a security challenge to the public introduces an immediate operational risk: how do you allow hundreds of engineers and security researchers to actively attack a web application without risking your production databases or leaking infrastructure credentials?
I addressed this through three architectural decisions:
- Zero Database Credential Exposure: The CTF storefront does not load or expose Database service roles, direct PostgreSQL connection strings, or administrative tokens to the client bundle. The entire application operates without granting client-side access to production datastores.
- Client-Side Session State with Edge Verification: Standard browsing, cart management, and profile changes operate responsively in browser memory and local session state, while sensitive exploit actions are evaluated against isolated serverless edge endpoints.
- Dynamic Completion Verification: I avoided static, reusable success markers. Achievements are tied to the participant and the moment of verified completion, so successful submissions provide proof rather than a transferable code.
3. The 4 Vulnerability Vectors (What Points & Skills They Test)
The challenge is structured into four sequential, realistic vectors. Each vector tests a specific competency required of senior full-stack engineers:
Vector 1: Reconnaissance & Object-Level Authorization
The first stage rewards careful observation rather than blind automation. As participants explore ordinary storefront activity, they encounter a pattern that raises questions about whether access to order information is truly scoped to the person requesting it.
What it tests: Broken Object Level Authorization (BOLA/IDOR) awareness and disciplined network reconnaissance. This stage serves as an information-gathering step: it reveals context that matters later, but does not itself award a badge.
Vector 2: Business-Layer Pricing Logic
The second stage creates an apparently normal checkout flow, while leaving room for the relationship between client state and server state to be misunderstood. Solving it requires asking where prices and discounts should originate, and whether the checkout process independently verifies what it was told.
What it tests: Understanding client-server trust boundaries, negative-value scenarios, and payment state validation. Completing this stage unlocks the Rising Talent badge.
Vector 3: Privilege Escalation Through Mass Assignment
The account-management stage focuses on a subtle API design failure: request data can be richer than the application intended. Participants must determine whether session identity and authorization are protected values or something that an incoming request can influence.
What it tests: Mass assignment awareness and the importance of strict request schemas in modern application backends.
Vector 4: Operational Audit & Full-Chain Reasoning
The final stage deliberately connects previously discovered context with the new authority earned in the account stage. It emphasizes that security failures are often not isolated bugs, but pieces that become more consequential when combined.
What it tests: Full-chain exploit orchestration, careful evidence gathering, and the ability to reason about administrative boundaries. This stage unlocks the Proven Talent badge.
4. Verifiable Achievement & Anti-Cheat Design
A public challenge needs to distinguish genuine exploration from copied or fabricated claims. To keep Roast My Portfolio achievements credible, successful stages produce participant-specific completion evidence that is checked by the server before the leaderboard is updated.
The important design principles are deliberately separate from the implementation details:
- Non-forgeability: Completion claims require server verification and cannot be issued by the client alone.
- Anti-replay & Non-transferability: Verified achievements are associated with the participant and completion event.
- Human-centered pacing: The challenge values normal investigation and reasoning rather than rapid automated submission.
- Clear boundaries: The implementation discourages generic crawling while keeping the public storefront and participant experience accessible.
5. Defensive Engineering: Remediation Patterns
Every vulnerability in Savvy 2.0 has a direct, battle-tested defensive fix that software engineers should adopt in production:
Strict DTO Validation Against Mass Assignment
Always validate incoming payloads against a strict schema that strips or rejects extraneous fields:
import { z } from 'zod';
const UpdateProfileSchema = z.object({
fullName: z.string().min(2).max(100),
email: z.string().email(),
marketingOptIn: z.boolean().default(false),
}).strict(); // Extraneous fields like 'role' immediately reject the requestAuthoritative Server-Side Price Recalculation
Never trust client payloads for totals, subtotals, or discounts. The server should receive only product identifiers and quantities, looking up prices from its authoritative catalog:
// Server-side authoritative calculation
const verifiedTotal = cartItems.reduce((acc, item) => {
const catalogItem = await db.products.findById(item.id);
return acc + (catalogItem.priceCents * item.quantity);
}, 0);Object-Level Scoping for IDOR Mitigation
Never query entities solely by client-supplied primary keys. Always scope queries to the authenticated user's organization or account:
const order = await db.orders.findOne({
where: {
id: req.params.orderId,
customerId: req.user.id, // Enforces object-level ownership
}
});
if (!order) return res.status(404).json({ error: "Order not found" });6. Conclusion & Try It Live
Building Savvy 2.0 demonstrated that hands-on proof of work is far more compelling than static claims. Instead of asking engineers whether they understand application security, the challenge provides an environment where they can demonstrate it directly.
You can test your skills against the live challenge at market.nogs.dev or view the public verified achievements on the Roast My Portfolio Leaderboard.
If you've read this far, you might be interested in what I build.
Get in TouchLet's connect
Find me across code, repositories, and engineering updates.
© 2026 Samuel. Built for clarity & performance.