hub: the large request's wait is keyed on the whole app set, not its shortened display list (security review)

The key was the display string cut after ten names, so two different app sets
with the same first ten names shared one wait and one operator mail.
largeSetKey is a SHA-256 of the full sorted set; the display string is only
shown. Test seen red; 2 mutations seen red (redproof-review-s2.txt).

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-15 14:52:02 +01:00
1 parent 1fac9c16f1
commit 6d2d4bd09d
4 files changed
+84 -3

No files matched your search

@@ -0,0 +1,21 @@
SECURITY FINDING 2 on the review-fix-1 commit — the wait's key was the shortened display list of the apps.
### RED: the new test before the fix (felhom.eu 1fac9c16)
=== RUN TestD84_TwoAppSetsThatDifferAfterTheTenthNameDoNotShareAWait
ended_large_marker_test.go:115: a different app set rode the first set's week (the two differ only after the tenth name): 10 agreed, [{App: Reason:2 snapshot id(s) wait for the next window: one window removes at most 10 snapshots of removed apps (the size of its own cap)}]
--- FAIL: TestD84_TwoAppSetsThatDifferAfterTheTenthNameDoNotShareAWait (0.05s)
FAIL
FAIL gitea.dooplex.hu/admin/felhom-hub/internal/offsitekeys 0.056s
FAIL
### After the fix: mutations
== MUTATION: the key is the shortened display list again
RED on the mutant, GREEN on the real file
--- FAIL: TestD84_TwoAppSetsThatDifferAfterTheTenthNameDoNotShareAWait (0.05s)
ended_large_marker_test.go:115: a different app set rode the first set's week (the two differ only after the tenth name): 10 agreed, [{App: Reason:2 snapshot id(s) wait for the next window: one window removes at most 10 snapshots
== MUTATION: the key depends on the order the names came in
RED on the mutant, GREEN on the real file
--- FAIL: TestD84_TwoAppSetsThatDifferAfterTheTenthNameDoNotShareAWait (0.05s)
ended_large_marker_test.go:121: the key must be one fixed-size value for one set, whatever its order: "9ab9de25768ac172235e119b76362ecddad33878fe9a7792cdddbe47236f9a87" "ab096ba45a5db065588d721c11c2ba547a9ed29e67941e6949d9ea4c9da9
2 mutations, 0 not a red-proof