•
•
•
•
•
•
•
•
The Ordinary PlayerThe Ordinary Player
HomePosts & WriteupsMembersContests

© 2025 - 2026 The Ordinary Player. All rights reserved.
Website theme & implementation © Rosemary (blog.rosemary.my.id)

•
The Ordinary PlayerThe Ordinary Player
HomePosts & WriteupsMembersContests

© 2025 - 2026 The Ordinary Player. All rights reserved.
Website theme & implementation © Rosemary (blog.rosemary.my.id)

Back to all writeups
Back to all writeups

Table of Contents

  • Trust Fall Writeup - PatriotCTF 2025
  • Reconnaissance
  • Discovering the User API
  • Enumerating User IDs
  • Root Cause Analysis
  • Flag
  • Conclusion
Cyber Security
November 24, 2025•
... views
•3 min read
By Rosemary

Trust Fall (Web) - PatriotCTF

A product-catalog app in PatriotCTF 2025 hid an IDOR vulnerability behind a hard-coded read-only token. By probing the backend API, user data could be accessed simply by changing the ID in the request. Enumerating those IDs eventually revealed the root profile, which exposed the flag and confirmed the app’s missing authorization controls.

#CTF#Web#IDOR#PatriotCTF

Trust Fall Writeup - PatriotCTF 2025

The challenge provided a small product‑catalog web application. At first glance, it behaved normally: products were listed on the main page, and each product linked to a detail view. Every request sent a hard‑coded token:

Authorization: Bearer trustfall-readonly

This was suspicious: real applications never bake tokens into client‑side JavaScript. Hard‑coded tokens often indicate that the challenge designer wants players to investigate the backend API directly.


Reconnaissance

The front‑end code revealed two interesting details:

  1. The application fetched data from the following endpoints:

    • /api/products
    • /api/products/<sku>
  2. There was a link to /admin, which always responded with 403 for our read‑only token.

While exploring the product API, nothing unusual appeared — just harmless product data with a field named updatedBy.

But the presence of that numeric user identifier suggested the existence of a user system behind the scenes.


Discovering the User API

By experimenting with likely paths, one of the key discoveries was that the backend exposed:

/api/users/<id>

Requests using the read‑only token were not restricted at all. For example, accessing:

/api/users/1

returned:

{
  "id": 1,
  "username": "inventory-analyst",
  "role": "inventory",
  "flag": null
}

A second user (id = 2) also contained flag: null. That meant the flag likely lived on another user profile. At this point the vulnerability was clear:

The API leaked user data by ID without any authorization checks. This is a classic Insecure Direct Object Reference (IDOR).


Enumerating User IDs

Given that user IDs were simple integers, the next logical step was to enumerate additional IDs.

Testing:

/api/users/0

returned:

{
  "id": 0,
  "username": "root",
  "role": "superuser",
  "flag": "PCTF{authz_misconfig_owns_u}"
}

This profile contained the challenge flag.


Root Cause Analysis

The vulnerability existed because:

• The backend returned user objects solely based on the numeric ID in the path. • No authentication or role‑based access control was enforced. • The read‑only bearer token was accepted for every user profile.

As a result, anyone with access to the client‑side JavaScript (including challenge players) could enumerate user IDs and extract sensitive information.


Flag

Obtained from:

/api/users/0

flag


Conclusion

The Trustfall challenge demonstrates how dangerous IDOR vulnerabilities can be. Even when an application appears harmless, exposing predictable object identifiers without proper authorization checks can leak sensitive data, including administrative secrets and flags.

This challenge reinforces a core principle in secure backend design:

Never trust client‑side tokens, and never expose internal objects without verifying who is requesting them.

Share this post

If you found this helpful, consider sharing it with your network!

Related Posts

  • Vorpal Masters (Web) - PatriotCTF

    This writeup reverses a small license binary from PatriotCTF 2025 to recover the valid key CACI-2025-PatriotCTF. By inspecting the format string, strcmp checks, byte-by-byte comparisons, and a simple arithmetic check on the numeric field, the three segments are revealed and assembled into the final license.

    November 24, 2025•3 min read
  • 🔐 SecureAuth™ (Web) - PatriotCTF

    This writeup shows how the SecureAuth™ API in PatriotCTF 2025 could be bypassed using a NoSQL injection trick by sending a password field with a MongoDB operator, allowing instant admin access and revealing the flag.

    November 24, 2025•2 min read
  • Timelock (Blockchain) - QnQSec 2025

    This writeup explains how the Timelock contract in QnQSec 2025 could be bypassed by abusing ERC-20 allowances. While the timelock blocked direct transfers from the player, it didn’t restrict transferFrom, allowing an attacker to drain the player’s tokens through an approved spender.

    November 1, 2025•3 min read
The Ordinary PlayerThe Ordinary Player
HomePosts & WriteupsMembersContests

© 2025 - 2026 The Ordinary Player. All rights reserved.
Website theme & implementation © Rosemary (blog.rosemary.my.id)