This repository was archived by the owner on May 29, 2026. It is now read-only.
Commit e1ba44c
committed
fix(security): ActionsController — require admin for all mutations
Every write surface (`create`/`update`/`patch`/`destroy`/`test`/
`migrateFromHooks`) was `@NoAdminRequired` with no per-tenant or owner
guard. Actions persist as workflow hooks that fire on every matching
object lifecycle event — a non-admin who briefly auths could register
attacker-chosen workflow logic that survives password reset, session
revocation, and even the source account being disabled (the action row
carries no owner check on execution → self-rearming hook).
Add `requireAdmin()` helper (returns 401/403 JSONResponse or null) and
call it at the top of every mutation. `index`/`show` stay
`@NoAdminRequired` so the management UI is still legible to non-admins.
Drive-by: `patch()` was forwarding to `update(objectId: $id)`, but
`update`'s signature is `update(int $id)` — fixed to `update(id: $id)`
so PATCH actually works.
Refs: #1419 review (blocker 6) — discussion_r31874944401 parent 442eca2 commit e1ba44c
1 file changed
Lines changed: 61 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| |||
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
101 | 139 | | |
102 | 140 | | |
103 | 141 | | |
| |||
248 | 286 | | |
249 | 287 | | |
250 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
251 | 293 | | |
252 | 294 | | |
253 | 295 | | |
| |||
297 | 339 | | |
298 | 340 | | |
299 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
300 | 346 | | |
301 | 347 | | |
302 | 348 | | |
| |||
341 | 387 | | |
342 | 388 | | |
343 | 389 | | |
344 | | - | |
| 390 | + | |
| 391 | + | |
345 | 392 | | |
346 | 393 | | |
347 | 394 | | |
| |||
361 | 408 | | |
362 | 409 | | |
363 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
364 | 415 | | |
365 | 416 | | |
366 | 417 | | |
| |||
393 | 444 | | |
394 | 445 | | |
395 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
396 | 451 | | |
397 | 452 | | |
398 | 453 | | |
| |||
483 | 538 | | |
484 | 539 | | |
485 | 540 | | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
486 | 545 | | |
487 | 546 | | |
488 | 547 | | |
| |||
0 commit comments