--- id: "bug-1958" status: "open" status_updated: "2026-10-10" status_note: "newly logged" component: "apiserver" severity: "security" timestamp: "2026-10-10T10:15:56Z" last_seen: "2026-10-10T10:15:56Z" occurrences: 1 files: ["src/frontend/apiserver/controllers/roles.go"] tags: ["apiserver", "security", "rbac"] related: ["bug-1952"] gitea_issue: 389 gitea_synced_status: "open" gitea_synced_hash: "499c8864257a" --- # bug-1958: apiserver lets any rbac:control grant create roles and extend its own role (privilege escalation) ## Description **Observed:** (source reading; follow-up of the 2026-10-10 P0 fixes (bug-1936..1957)) Reported by the bug-1952 fix: role create/update in `controllers/roles.go` accepts any `rbac:control` scope, so a user holding `rbac:control` with scope `self` can add `cluster:control` (or any permission) to a role it already holds: the same escalation bug-1952 closed for user-role assignment, by another route. **Expected:** Creating roles or changing a role's permissions requires `rbac:control` with scope `all` (as user-role changes do since bug-1952). **Impact:** Security: privilege escalation through role editing. **Found by:** follow-up of the 2026-10-10 P0 fixes (bug-1936..1957) ## Environment - OS: no /etc/os-release; Docker container; NixOS kernel; kernel Linux 6.18.33 x86_64 - libc: glibc 2.42-47 (interpreter /nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/ld-linux-x86-64.so.2) - Toolchain: gcc (GCC) 15.2.0, meson 1.9.1 - Build: asan (xce.build) - Code: scheduler-framework @ 19be145d-dirty - Deployment: any (found by source reading; confirmed by the RED test of the fix) ## Reproduction 1. Give user mallory a role with `rbac:control` scoped `self`. 2. As mallory, add `cluster:control` (domain all) to that role through the roles API; it is accepted. - Frequency: deterministic (by code reading; confirmed by the RED test of the fix) - Evidence: the code sites quoted in Description; no logs kept. ## Root cause TODO: required for fixed/partial ## Fix TODO: required for fixed/partial ## Verification - Test: TODO: name + file; RED before the fix, GREEN after - Suites: TODO: suite results and build profile - Live: TODO: soak/deploy run, or n/a and why ## References - Related: none