Fix/review findings #1

Merged
Matte23 merged 4 commits from fix/review-findings into main 2026-11-18 20:51:39 +00:00
Owner
No description provided.
Matte23 added 4 commits 2026-11-18 20:51:31 +00:00
Reports
- Sharing within a team is no longer reported: owner and submitter are
  compared by account (the team in teams mode), not by user.
- Admins (e.g. testing in preview mode) are never reported.
- A personal flag without a valid owner no longer crashes the submission
  (int() of its data raised a 500); empty flags never match.
- One report per cheater, challenge and flag (unique constraint plus a
  check before inserting): "all" logic re-checks every earlier submission
  on each attempt, which created duplicates. Migration 5b1e0c7d9a24 drops
  existing duplicates and adds the constraint.
- Every new report is logged. Matching uses hmac.compare_digest.

Flags and helpers
- The admin flag forms sent the owner as "user id", which CTFd's flag
  API ignores: personal flags created by admins had no owner. They now
  send "data", with labels bound to their inputs.
- create_flag_if_missing only considers personal flags, deterministically.

Plugin
- Migrations run under the plugin's real directory (was "cheaters");
  asset paths follow the directory instead of hardcoding it.
- Model renamed CheatReport (owner instead of helper); table and column
  names unchanged. Dates stored in UTC.
- Admin page: newest first, paginated, related rows loaded with the page,
  real report ids, url_for links, team columns in teams mode, local-time
  dates, and a Dismiss action.
- README (install as ctfd_cheaters, "any" logic, API for other plugins);
  pyrightconfig without an absolute path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- plugin_tests/: 9 tests running the plugin inside CTFd 3.8.9's test app
  (users and teams mode): own/shared flags, single reports, admins,
  invalid owners and empty flags, teams, create_flag_if_missing, the
  admin flag form, the admin page and dismissing.
- make venv (uv, Python 3.11), make lint, make format, make test: same
  tools and versions as ctfd-whale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CTFd's Flags model sets polymorphic_on without mapping any type, so every
flag flush warns. Mapping "personal" would break loading the other types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Matte23 merged commit e0338e6438 into main 2026-11-18 20:51:39 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Matte23/ctfd-cheaters#1