fix(agent): enforce client identity for user-scope execution in dev mode - #1892
Conversation
The broker Windows executor's development (non-SYSTEM) mode ran commands under the broker process token regardless of which user connected to the pipe, so a user-scope install requested by a different user would land in the broker user's profile. Reject execution when the pipe client SID does not match the broker process user SID. Also clarify the SYSTEM-mode error when the target user has no active logon session, since user-scope and interactive operations require one. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Let maintainers know that an action is required on their side
|
|
Implementation notes (audit findings for DGW-436): Verified as already correct (SYSTEM/service mode) —
Gap fixed (development/non-SYSTEM mode) — Why not a capability flag: Testing: new unit test |
Ensures package operations always run in the requesting user's own context.
In service (SYSTEM) mode the broker already launches operations with the client user's real session token, so user-scope installs land in the correct profile (
%LOCALAPPDATA%, HKCU) and interactive installer UIs appear on the user's desktop rather than in session 0.This change closes a gap in development (non-SYSTEM) mode: the executor ran commands under the broker process token regardless of which user connected to the pipe, so a user-scope install requested by a different user would silently land in the broker user's profile. Such requests are now rejected with a clear error.
The error reported when the target user has no active logon session is also clarified, since user-scope and interactive operations require the user to be logged on.
Issue: DGW-436