You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1] [security] kill_process has no self-protection — can kill own admin connection #433
[P1] [security] kill_process lacks self-protection guard — user can kill the connection the admin panel is running on
Context
api.killProcess(connectionId, processId) is invoked with the same connectionId the admin tab is using. processes rows include the pool's own connection.
Problem
Per docs/audits/admin.md F5.
A user who clicks the skull next to their own connection ID gets a KILL confirmation; the KILL succeeds; pool auto-acquires a different connection; next fetchProcesses resolves... but if user kills the LAST connection, the pool exhausts and the panel shows "Failed to kill process: pool timed out" without telling them they killed themselves. No PROCESS privilege check — SELECT-only users see processes (visible to all since MySQL 5.7) but their KILL fails with ERROR 1095 (HY000): You are not owner of thread.
Files
src/components/admin/AdminPanel.tsx:108-116
src-tauri/crates/mas-admin/src/lib.rs:96-122
Repro (if applicable)
Static analysis only.
Expected
Click kill next to admin's own connection ID → tooltip "Cannot kill your own connection" and button disabled. Click kill on another user's connection works. SELECT-only privilege → clear "PROCESS privilege required" message.
Proposed fix
Scope M. (a) Filter own connection from process list, or show visually distinct (greyed, no kill button). (b) Catch "not owner of thread" in kill_process and convert to clearer message.
Acceptance
Own connection is non-killable; other users' connections are; SELECT-only user sees clear privilege message.
Done in #522. The pool records each server thread it opens in after_connect, kill_process refuses those, and the UI disables the button with an explanatory tooltip rather than letting the click fail. ERROR 1095 is translated into a message naming the missing privilege. Integration tests confirm the app's own threads are refused, the connection still works after the refusal, and a connection opened outside the pool is still killable — so the guard is not a blanket refusal.
Activity
fix(admin): enforce read-only connections, and stop the app killing i…
EVWorth commentedon Aug 29, 2026
Done in #522. The pool records each server thread it opens in
after_connect,kill_processrefuses those, and the UI disables the button with an explanatory tooltip rather than letting the click fail. ERROR 1095 is translated into a message naming the missing privilege. Integration tests confirm the app's own threads are refused, the connection still works after the refusal, and a connection opened outside the pool is still killable — so the guard is not a blanket refusal.