Writeup · 31 Nights of Root

Hermes Manifest

webmediumsolvedFlag: r00t{REDACTED}

Overview

Hermes Manifest is themed as a courier and cargo tracking terminal for a fictional logistics hub in Piraeus. The landing page is a static dashboard that acquires a courier session and lists “my shipments”. A “Developer Access” panel openly advertises a GraphQL API with introspection enabled, plus two internal-ops features: an attachment bundle uploader and report generation.

The challenge description — “Can you better the God of Travel and compromise his system?” — hints at Hermes, the messenger god, and at compromising the host rather than just the web app. It is a two-flag box: a low-privileged web RCE as tracking-svc, followed by a root cron privilege escalation.

Prerequisites / Setup

export TARGET="<challenge URL or IP>"

curl, python3, and zip are sufficient; no wordlist or credentials are required.

Recon

Step 1 — Inspect the application

Goal: Confirm the GraphQL endpoint with introspection enabled and the two internal-ops endpoints.

curl -s "$TARGET/"

The landing page exposes:

  • GET / — static dashboard
  • POST /api/session — issues a bearer token
  • GET /api/shipments/mine — requires bearer token
  • POST /graphql — GraphQL with introspection, requires bearer token
  • POST /attachments/upload — ZIP upload with X-Attachment-Key header
  • POST /reports/generate — loads Python plugins from /app/report_plugins

Step 2 — GraphQL introspection

Goal: Obtain a bearer token and discover the GraphQL schema.

curl -s -X POST "$TARGET/api/session"

Returns {"account":"courier-customer","token":"<token>"}.

curl -s -X POST "$TARGET/graphql" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ __schema { types { name kind fields { name type { name kind } } } } }"}'

Vulnerability Analysis

The flaw classes are GraphQL Introspection (information disclosure), Zip Slip (CWE-22: Path Traversal), Unsafe Plugin Loading (arbitrary code execution), and Insecure Direct Object Reference (metadata service access without authorization).

Exploitation

Step 3 — GraphQL introspection → ZIP Slip → plugin RCE

Goal: Chain GraphQL introspection, ZIP Slip, and plugin loading to achieve remote code execution as tracking-svc.

Use GraphQL introspection to discover the schema, then upload a ZIP archive with a path-traversing entry (../report_plugins/malicious.py) to write a malicious Python plugin. Trigger the report generation endpoint to load the plugin and execute arbitrary commands.

Step 4 — Metadata service → role assumption → backup restore

Goal: Use the instance metadata service to assume a role and restore a backup, escalating privileges further.

Use the RCE to access the instance metadata service (169.254.169.254), obtain temporary credentials, assume a more privileged role, and restore a backup to gain further access.

Flag

r00t{REDACTED}

First flag (user) retrieved via RCE as tracking-svc; second flag (root) retrieved via ZIP Slip → plugin RCE → metadata service → role assumption → backup restore.

Lessons / Takeaways

  • Never expose GraphQL introspection in production without authentication.
  • Validate ZIP entry names to prevent path traversal (Zip Slip).
  • Never load plugins from user-writable directories; use signed plugin verification.
  • Restrict access to instance metadata services to only authorized application contexts.
  • Implement backup/restore with proper authorization checks.

Mitigations

  • Disable GraphQL introspection in production or restrict it to authenticated administrators.
  • Validate and sanitize ZIP entry names to prevent path traversal.
  • Implement signed plugin verification and load plugins only from trusted, read-only directories.
  • Restrict access to instance metadata services to only authorized application contexts.
  • Implement proper authorization checks on backup/restore endpoints.

Techniques

References