Commit Graph
22 Commits
Author SHA1 Message Date
Matte23 e0338e6438 Merge pull request 'Fix/review findings' (#1) from fix/review-findings into main
Reviewed-on: #1
2026-11-18 20:51:39 +00:00
Matte23andClaude Opus 5.5 a42e7f2823 fix: Silence CTFd's Flags polymorphic-identity warning on flag creation
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>
2026-11-18 18:38:48 +01:00
Matte23andClaude Opus 5.5 396c7afb9f refactor: Drop a redundant sentence from the cheaters page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 18:31:21 +01:00
Matte23andClaude Opus 5.5 e54d98498c test: Test suite against CTFd's own test app, lint tooling
- 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>
2026-11-18 10:21:53 +01:00
Matte23andClaude Opus 5.5 8084b3996a fix: Reliable cheat reports and a usable admin side
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>
2026-11-18 10:21:53 +01:00
Matte23 47b9a8a7f1 feat: Flag shared are considered valid 2025-11-10 17:27:47 +01:00
Matte23 3e9940150d fix: I'm getting tired of those errors 2025-11-07 17:39:02 +01:00
Matte23 1a4e72a287 fix: Wron query in create_flag_if_missing 2025-11-07 17:33:46 +01:00
Matte23 b72b373d8d fix: Change all() with first() 2025-11-07 17:14:18 +01:00
Matte23 803bb45693 fix: Cast user id to string before using it inside the flag 2025-11-07 15:48:14 +01:00
Matte23 584a91357b feat: Better UI for flag creation 2025-11-07 14:19:23 +01:00
Matte23 cfcbda732d fix: Move report_cheater to flags to avoid circular import 2025-11-07 14:14:54 +01:00
Matte23 3139c08c91 feat: Add PersonalFlag flag with automatic cheat reporting 2025-11-07 14:04:01 +01:00
Matte23 0609c6cb61 fix: Variables in template 2025-11-06 18:24:29 +01:00
Matte23 d81521dea7 fix: Wrong parameter in report_cheater 2025-11-06 18:02:39 +01:00
Matte23 716f481235 feat: Store flag id instead of flag content 2025-11-06 17:06:03 +01:00
Matte23 644242697a fix: Missing import 2025-11-06 15:01:58 +01:00
Matte23 e4532411ce feat: Add menu entry for cheater list 2025-11-06 14:58:43 +01:00
Matte23 5a229da611 fix: Wrong challenge table name 2025-11-06 14:24:05 +01:00
Matte23 e0dac9b043 fix: Undefined functions 2025-11-06 14:17:24 +01:00
Matte23 903c529c0b feat: First commit 2025-11-06 14:11:45 +01:00
Matte23 2b0f9b9749 Initial commit 2025-11-06 12:52:41 +00:00