Commit 361e57b
committed
fix(linear): authorize comment triggers before acting (review MEDIUM security)
The issue→task path gated on lookupPlatformUser; the comment path did NOT. Any
workspace member or guest who could post @bgagent could approve/reject plans,
drive plan commands, and start code-pushing agent runs — all attributed to and
BILLED against the original requester. handleCommentTrigger now resolves the
commenter (payload.actor.id) to a platform user BEFORE any verdict/command/
dispatch; an unmapped commenter gets a ❓ reaction + a one-line 'link your
account first' reply and the trigger is refused. The near-miss-mention nudge
stays ahead of the gate (a nudge is not a privileged action); an app-actor
commenter is correctly unmapped (the app can't self-authorize).
Tests: unmapped-commenter-blocked regression + updated the shared ddbSend mocks
to return a mapped commenter (linear_identity Get) so the actionable paths pass.
cdk typecheck + 86 comment-path tests green.1 parent 43d0c97 commit 361e57b
2 files changed
Lines changed: 59 additions & 1 deletion
File tree
- cdk
- src/handlers
- test/handlers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1450 | 1450 | | |
1451 | 1451 | | |
1452 | 1452 | | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
1453 | 1482 | | |
1454 | 1483 | | |
1455 | 1484 | | |
| |||
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
453 | 459 | | |
454 | 460 | | |
455 | 461 | | |
| |||
462 | 468 | | |
463 | 469 | | |
464 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
465 | 475 | | |
466 | 476 | | |
467 | 477 | | |
| |||
562 | 572 | | |
563 | 573 | | |
564 | 574 | | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
565 | 592 | | |
566 | 593 | | |
567 | 594 | | |
| |||
721 | 748 | | |
722 | 749 | | |
723 | 750 | | |
724 | | - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
725 | 754 | | |
726 | 755 | | |
727 | 756 | | |
| |||
0 commit comments