Skip to content

feat(ctf): per-instance flags derived via HMAC(CTF_KEY, slug) #316

Description

@kOaDT

Context

All 36 flags are static and published in prisma/flags.ts, so anyone with repo access can submit them without solving anything — making "CTF" inaccurate for a competition where players see the source.
Decide the design before inviting a PR: this touches the seed, verify route, walkthroughs (which quote literal flags), the Hall of Fame, ...

Design decisions to make first

  • Flag format when keyed (keep OSS{…}? length?).
  • Training mode (no key) must stay identical to today for self-study.
  • What to do about walkthroughs that quote literal flag values.

Tasks (after the note)

  • Add CTF_KEY; when set, derive each flag as HMAC(CTF_KEY, slug) at seed/verify time.
  • Keep unkeyed training mode unchanged.
  • Update /api/flags/verify and the seed; document both modes.

Acceptance criteria

  • With CTF_KEY set, flags differ per deployment and no repo literal validates; training mode unchanged.

Files

  • prisma/flags.ts, prisma/seed.ts, app/api/flags/verify/route.ts, docs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions