T06 · System Persistence
- Location
SKILL.md:12- Finding
External Migration Script Installs a Persistent launchd Refresh Job
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12-18
Vulnerability Type:T06: System Persistence
Risk Level: HighComplete Code Snippet:
markdown ```bash clawhub uninstall agent-token-usage-ui clawhub install agent-token-usage bash ~/.openclaw/workspace/skills/agent-token-usage/apply-ui.shThe 📊 button, modal, and launchd refresh job are all included in the main skill now under
apply-ui.sh/remove-ui.sh.text ### Technical Analysis The migration instructions tell the user to execute `apply-ui.sh` from a separately installed package. The document explicitly states that this script installs a `launchd` refresh job. A launchd job is a cross-session execution mechanism on macOS and therefore constitutes system persistence under the specified classification. The persistent behavior is disclosed rather than concealed, but the project does not include the referenced script, launchd property list, executed command, trigger conditions, or removal implementation. Consequently, this audit cannot verify whether the job is appropriately scoped, runs only as the current user, invokes immutable content, or is removed completely by `remove-ui.sh`. ### Attack Path 1. A user follows the migration instructions in `SKILL.md`. 2. The user installs the external `agent-token-usage` package. 3. The user executes its `apply-ui.sh` script through Bash. 4. According to the documentation, the script creates a launchd refresh job. 5. The installed job survives the original skill invocation and runs according to its configured launchd triggers. 6. If the external script or installed package is maliciously modified, the persistent job could repeatedly execute package-controlled commands. ### Impact Assessment The confirmed scope is persistent execution through a launchd refresh job. Its exact privileges cannot be established from the reviewed project because neither the script nor its launchd co ...[truncated 609 chars]- Remediation
View remediation
Remediation Suggestions
- Do not install the launchd job as an implicit side effect of enabling the UI.
- Require separate, explicit user consent before creating any persistent service or scheduled job.
- Display the exact property-list contents, executable path, arguments, trigger conditions, and privilege level before installation.
- Install the job with the least possible privilege, preferably as a user LaunchAgent rather than a system LaunchDaemon.
- Ensure all referenced executables and configuration files are owned by the expected user and are not writable by less-privileged accounts.
- Use absolute paths and a constrained environment in the launchd configuration.
- Provide and test a complete removal procedure that unloads the job and deletes its property list and generated files.
- Include the applicable scripts and launchd configuration in the reviewed package so their behavior can be audited before execution.
