T06 · System Persistence
Error
- Location
- SKILL.md:118
- Finding
- Hidden Login Startup and Watchdog Establish Cross-Session Persistence## Vulnerability Details **File Location**: `SKILL.md`, lines 118–123 and line 137 **Vulnerability Type**: Hidden startup execution and automatic process restart **Risk Level**: High ### Evidence The following is an English rendering of the relevant documentation, with commands, paths, and configuration literals preserved: ```text ## 11. Automatic startup, watchdog, and manual startup by the agent GBrain has no built-in automatic startup or watchdog. `gbrain serve --http` runs a standalone HTTP service on port 3131 with the MCP endpoint `/mcp`. Watchdog batch file: C:\Users\<username>\.gbrain\gbrain-serve.bat The batch file performs a port check, uses a `:loop` to restart the service after a crash, and writes to `gbrain-serve.log`. Login startup file: C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\GBrainServe.vbs VBS execution: ws.Run "...\gbrain-serve.bat", 0, False `0` hides the execution window. The VBS file is executed at Windows login without passing through WorkBuddy, allowing the hidden watchdog to operate. Long-term startup continues to rely on the VBS file in the Startup directory and takes effect at the next login. ``` ### Technical Analysis The Skill instructs the operator or agent to place a VBS launcher in the current user's Windows Startup directory. Files in this directory are executed automatically when that user logs in. The launcher invokes a batch-file watchdog with `ws.Run` and the window-style argument `0`, which hides the process window. The watchdog contains a restart loop, causing the GBrain HTTP/MCP service to return after failure. These mechanisms jointly provide: - Automatic execution at future user logins. - Operation beyond the lifetime of the initiating Skill session. - Hidden execution with reduced user visibility. - Automatic process recovery after crashes. - A persistent local MCP endpoint on port 3131. Pers ...[truncated 1991 chars]
- Remediation
- ## Remediation Suggestions 1. Remove instructions that create `GBrainServe.vbs` in the Windows Startup directory. 2. Remove hidden-window execution through `ws.Run ..., 0, False`. 3. Do not create a restart loop unless the user has explicitly approved installing a persistent service. 4. Require separate, informed confirmation before making any cross-session system modification. 5. If continuous operation is legitimately required, use an administrator-approved service manager with: - A descriptive service name. - A documented executable path and arguments. - Least-privilege service credentials. - Explicit startup and recovery policies. - Visible status and audit logs. - A documented disable and uninstall procedure. 6. Bind the MCP service only to the required interface, preferably loopback, and verify that it cannot accept remote connections. 7. Require authentication and authorization for tools that read, import, modify, or administer knowledge-base content. 8. Document all created files, processes, ports, and persistence entries before installation. 9. Provide removal instructions for both `GBrainServe.vbs` and `gbrain-serve.bat`. 10. Treat persistence as an optional deployment action, not as an automatic behavior of the Skill.
