Commit 7b5387c
authored
fix(security): prevent fail-open in role permission checker (#23)
The `RolePermissionChecker.scopeMatches` method previously returned `true` by default for unhandled scope types. This could allow unauthorized access if a new scope type was added without updating the permission logic. This change enforces a "Fail Closed" strategy by returning `false` for any unknown scope types.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 53e5ab5 commit 7b5387c
2 files changed
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | | - | |
| 53 | + | |
55 | 54 | | |
56 | | - | |
57 | 55 | | |
58 | 56 | | |
59 | | - | |
| 57 | + | |
60 | 58 | | |
61 | | - | |
62 | 59 | | |
63 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| |||
0 commit comments