T09 · Insecure Skill Coding Practices
- Location
scripts/cpu-temp-monitor.sh:17- Finding
Gateway bearer token exposed through process command-line arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/cpu-temp-monitor.sh:17
Additional Location:SKILL.md:23
Vulnerability Type: Exposure of sensitive credentials through process arguments
Risk Level: MediumVulnerable Code
bash -H "Authorization: Bearer $(cat /home/weiye/.openclaw/gateway-token 2>/dev/null)" \Technical Analysis
The shell command substitution reads the OpenClaw gateway token and interpolates it directly into a
curlcommand-line argument. Consequently, the expanded Authorization header can appear in the process argument vector whilecurlis running.A local process with sufficient same-user access, process-inspection permissions, or access to an inadequately restricted
/procfilesystem may inspect the command line and recover the bearer token. The hard-coded/home/weiyepath also assumes a specific user account and does not verify the token file's ownership or permissions.The same insecure pattern is included in the installation example in
SKILL.md, encouraging users to reproduce it.Attack Path
- An attacker obtains local process-observation capability, such as access to process command lines under the monitoring user's account.
- The measured CPU temperature exceeds the configured threshold, causing the script to invoke
curl. - The shell expands the token file contents into the Authorization header argument.
- While
curlis running, the attacker monitors process arguments and captures the bearer token. - The attacker reuses the token to make unauthorized requests to the local OpenClaw gateway, subject to the permissions assigned to that token and network access to the gateway.
Exploitation requires local process visibility and suitable timing; restrictive
/procsettings or process-isolation controls may reduce practical exposure.Impact Assessment
Successful exploitation discloses the OpenClaw gateway bearer token. The attacker ma ...[truncated 587 chars]
- Remediation
View remediation
Remediation Suggestions
- Avoid placing the bearer token in command-line arguments. Supply sensitive configuration through a mechanism that does not expose it in the process argument vector, such as a protected
curlconfiguration supplied through standard input. - Store the token path in a configurable environment variable or configuration file rather than hard-coding a user-specific home directory.
- Before use, verify that the credential file is a regular file, owned by the expected user, and restricted to owner access, such as mode
0600. - Run the monitor under a dedicated unprivileged account and grant that account access only to the temperature interface and the specific gateway operation required for alerting.
- Apply restrictive process-observation controls where supported, including appropriately configured
/procmount options. - Update the example in
SKILL.mdso users do not reproduce the vulnerable command-line credential handling. - Configure the gateway token with the minimum API scope required to send temperature alerts, and rotate the existing token if command-line exposure may already have occurred.
- Avoid placing the bearer token in command-line arguments. Supply sensitive configuration through a mechanism that does not expose it in the process argument vector, such as a protected
