T06 · System Persistence
Error
- Location
- install.sh:201
- Finding
- <![CDATA[Deprecated Skill Installs a Persistent Credential-Handling LaunchAgent]]><![CDATA[ ## Vulnerability Details **File Location**: `install.sh:201-240` **Vulnerability Type**: Persistent scheduled service exceeding current functional necessity **Risk Level**: High ### Vulnerable Code ```bash <key>StartInterval</key> <integer>7200</integer> <key>RunAtLoad</key> <true/> <key>StandardOutPath</key> <string>$HOME/clawd/logs/claude-oauth-refresher-stdout.log</string> <key>StandardErrorPath</key> <string>$HOME/clawd/logs/claude-oauth-refresher-stderr.log</string> <key>WorkingDirectory</key> <string>$SCRIPT_DIR</string> <key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/.local/bin</string> </dict> </dict> </plist> EOF echo -e "${GREEN}✓${NC} Created $PLIST_FILE" echo "" # Step 5: Install launchd plist echo -e "${BLUE}[5/6]${NC} Installing launchd service..." mkdir -p "$LAUNCHAGENTS_DIR" # Unload if already loaded if launchctl list | grep -q "com.clawdbot.claude-oauth-refresher"; then launchctl unload "$LAUNCHAGENTS_DIR/$PLIST_FILE" 2>/dev/null || true echo " → Unloaded existing service" fi cp "$SCRIPT_DIR/$PLIST_FILE" "$LAUNCHAGENTS_DIR/$PLIST_FILE" launchctl load "$LAUNCHAGENTS_DIR/$PLIST_FILE" ``` ### Technical Analysis The installer creates and loads a per-user macOS LaunchAgent with `RunAtLoad` enabled and a 7,200-second execution interval. This causes `refresh-token.sh` to survive the installation session and execute at login/load and every two hours. Automatic scheduling was historically related to the Skill's declared token-refresh purpose, and the persistence behavior is disclosed in `SKILL.md` and `QUICKSTART.md`. However, `README.md:1-10` explicitly states that the Skill is deprecated because Clawdbot now provides native token refresh. Installing an additional persistent process that repeatedly accesses OAuth credentials therefore exceeds the minimum privileges and ...[truncated 1896 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Disable or remove `install.sh` from the deprecated release and direct users to `clawdbot onboard --auth-choice claude-cli`. 2. Do not install a LaunchAgent by default. If legacy scheduling must remain available, require a separate, explicit opt-in after clearly explaining that it creates a persistent credential-handling service. 3. Install executable code into a user-owned directory with restrictive permissions and verify ownership and permissions before loading it. 4. Refuse to run if the script or configuration is writable by other users. 5. Use modern `launchctl bootstrap` and `bootout` commands with an explicit user GUI domain where supported. 6. Correct `README.md:27` to use the actual plist name: `com.clawdbot.claude-oauth-refresher.plist`. 7. Add an upgrade or migration routine that detects and removes legacy LaunchAgents after confirming with the user. 8. Document a complete removal check, including verification that `launchctl list` no longer contains the service label. ]]>
