# oyossss/staff_only architecture

> Architecture diagram of the GitHub repository oyossss/staff_only, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oyossss/staff_only
- Repository: https://github.com/oyossss/staff_only

## Overview

STAFF_ONLY is a Flask concert-ticketing security challenge. A user registers, reserves a ticket, and submits its page for administrator review; the review bot visits the page, enabling CSS-injection timing measurements to recover the administrator’s staff code. That code unlocks `/list`, where an SSTI payload can expose the flag. The core route, database, and bot behavior is visible in `app.py`; exploit-stage links and the ticket CSS behavior are documented in the README, while template implementations were not provided.

Main entry points: [`app.py`](https://github.com/oyossss/staff_only/blob/main/app.py) (Admin Ticket Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Ticket Web App"]
  node_ticket_routes["Ticket Routes<br/>[app.py]"]
end

subgraph group_state["Identity and Tickets"]
  node_auth["Login and Registration<br/>[app.py]"]
  node_ticket_booking["Seat Booking<br/>[app.py]"]
  node_ticket_db[("Users and Tickets<br/>[app.py]")]
end

subgraph group_review["Admin Review"]
  node_report_route["Report Route<br/>[app.py]"]
  node_review_bot["Browser Review Bot<br/>[app.py]"]
  node_admin_page["Admin Ticket Page<br/>[app.py]"]
end

subgraph group_exploit["Staff Challenge"]
  node_css_payload["Ticket CSS Injection<br/>[app.py]"]
  node_timing_probe["Timing Extraction"]
  node_staff_code["Staff Code<br/>[app.py]"]
  node_staff_list["Staff List Page<br/>[app.py]"]
  node_ssti["MOTD SSTI<br/>[app.py]"]
  node_flag["Challenge Flag"]
end

node_visitor(("Ticket User"))

node_visitor -->|"registers or logs in"| node_auth
node_auth -->|"reads and writes"| node_ticket_db
node_visitor -->|"reserves seat"| node_ticket_booking
node_ticket_booking -->|"writes ticket"| node_ticket_db
node_visitor -->|"submits report"| node_report_route
node_report_route -->|"visits URL"| node_review_bot
node_review_bot -->|"logs in as admin"| node_auth
node_review_bot -->|"opens ticket page"| node_admin_page
node_admin_page -->|"reads ticket"| node_ticket_db
node_admin_page -->|"renders for admin"| node_staff_code
node_admin_page -->|"applies ticket CSS"| node_css_payload
node_visitor -->|"measures response"| node_timing_probe
node_timing_probe -->|"infers characters"| node_staff_code
node_visitor -->|"presents code"| node_staff_list
node_staff_list -->|"checks staff code"| node_ticket_db
node_visitor -->|"supplies MOTD"| node_ssti
node_ssti -->|"reads flag file"| node_flag

click node_ticket_routes "https://github.com/oyossss/staff_only/blob/main/app.py"
click node_auth "https://github.com/oyossss/staff_only/blob/main/app.py"
click node_ticket_booking "https://github.com/oyossss/staff_only/blob/main/app.py"
click node_ticket_db "https://github.com/oyossss/staff_only/blob/main/app.py"
click node_report_route "https://github.com/oyossss/staff_only/blob/main/app.py"
click node_review_bot "https://github.com/oyossss/staff_only/blob/main/app.py"
click node_admin_page "https://github.com/oyossss/staff_only/blob/main/app.py"
click node_css_payload "https://github.com/oyossss/staff_only/blob/main/app.py"
click node_staff_code "https://github.com/oyossss/staff_only/blob/main/app.py"
click node_staff_list "https://github.com/oyossss/staff_only/blob/main/app.py"
click node_ssti "https://github.com/oyossss/staff_only/blob/main/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ticket_routes,node_visitor toneBlue
class node_auth,node_ticket_booking,node_ticket_db toneAmber
class node_report_route,node_review_bot,node_admin_page toneMint
class node_css_payload,node_timing_probe,node_staff_code,node_staff_list,node_ssti,node_flag toneRose
```

## Components

### Ticket Web App

- [Ticket Routes](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`

### Identity and Tickets

- [Login and Registration](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`
- [Seat Booking](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`
- [Users and Tickets](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`

### Admin Review

- [Report Route](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`
- [Browser Review Bot](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`
- [Admin Ticket Page](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`

### Staff Challenge

- [Ticket CSS Injection](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`
- **Timing Extraction**
- [Staff Code](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`
- [Staff List Page](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`
- [MOTD SSTI](https://github.com/oyossss/staff_only/blob/main/app.py): `app.py`
- **Challenge Flag**

### Other components

- **Ticket User**

## Connections

- Ticket User → Login and Registration: registers or logs in (evidence: `app.py`)
- Login and Registration → Users and Tickets: reads and writes (evidence: `app.py`)
- Ticket User → Seat Booking: reserves seat (evidence: `app.py`)
- Seat Booking → Users and Tickets: writes ticket (evidence: `app.py`)
- Ticket User → Report Route: submits report (evidence: `app.py`)
- Report Route → Browser Review Bot: visits URL (evidence: `app.py`)
- Browser Review Bot → Login and Registration: logs in as admin (evidence: `app.py`)
- Browser Review Bot → Admin Ticket Page: opens ticket page (evidence: `README.md`)
- Admin Ticket Page → Users and Tickets: reads ticket (evidence: `app.py`)
- Admin Ticket Page → Staff Code: renders for admin (evidence: `app.py`)
- Admin Ticket Page → Ticket CSS Injection: applies ticket CSS (evidence: `README.md`)
- Ticket User → Timing Extraction: measures response (evidence: `README.md`)
- Timing Extraction → Staff Code: infers characters (evidence: `README.md`)
- Ticket User → Staff List Page: presents code (evidence: `README.md`)
- Staff List Page → Users and Tickets: checks staff code (evidence: `app.py`)
- Ticket User → MOTD SSTI: supplies MOTD (evidence: `README.md`)
- MOTD SSTI → Challenge Flag: reads flag file (evidence: `README.md`)
