This repository was archived by the owner on May 29, 2026. It is now read-only.
Commit 35aae9f
committed
fix(security): NotificationHistoryController — force recipient = caller for non-admins
`index()` is `#[NoAdminRequired]` and forwarded the caller-supplied
`recipient` filter straight to the mapper with no scoping. Any authed
Bob could call `/api/notification-history?recipient=alice` and read
Alice's full history — channels, status, ruleId, dispatch timestamps,
across tenants. This is the privacy/recon persistence vector flagged
in the strict review.
Fix: when the caller is not admin, force `recipient = currentUid`
regardless of any value they passed; admins keep the free filter so
operators can still audit. Existing 500-row page cap stays.
Refs: #1419 review (blocker 3) — discussion_r31874944211 parent 265ee3b commit 35aae9f
1 file changed
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
52 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| |||
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
73 | 86 | | |
74 | | - | |
75 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
76 | 100 | | |
77 | 101 | | |
78 | 102 | | |
| |||
0 commit comments