Commit 5ad21df
fix: Correct RBAC check ordering in PutSessionWorkspaceFile to prevent session enumeration
Moves session existence check to immediately after RBAC validation,
before service lookup. This prevents unauthorized users from
enumerating valid session names by observing different error responses.
Security improvement:
- RBAC check first (line 2568-2589)
- Session existence check second (line 2591-2602)
- Service lookup third (line 2604-2620)
This matches the pattern already implemented in DeleteSessionWorkspaceFile
and follows the security standards defined in CLAUDE.md.
Fixes the issue identified in PR review at sessions.go:2578-2591.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent bad8359 commit 5ad21df
1 file changed
+15
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2566 | 2566 | | |
2567 | 2567 | | |
2568 | 2568 | | |
| 2569 | + | |
2569 | 2570 | | |
2570 | 2571 | | |
2571 | 2572 | | |
| |||
2587 | 2588 | | |
2588 | 2589 | | |
2589 | 2590 | | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
2590 | 2604 | | |
2591 | 2605 | | |
2592 | 2606 | | |
| |||
2606 | 2620 | | |
2607 | 2621 | | |
2608 | 2622 | | |
2609 | | - | |
| 2623 | + | |
2610 | 2624 | | |
2611 | | - | |
2612 | | - | |
2613 | | - | |
2614 | | - | |
2615 | | - | |
2616 | | - | |
2617 | | - | |
2618 | | - | |
2619 | | - | |
2620 | | - | |
2621 | 2625 | | |
2622 | 2626 | | |
2623 | 2627 | | |
| |||
0 commit comments