T09 · Insecure Skill Coding Practices
- Location
scripts/get_stats.sh:4- Finding
API Key Exposed Through Curl Process Arguments in Statistics Retrieval
- Content
View full analysis
Vulnerability Details
File Location:
scripts/get_stats.sh:4
Vulnerability Type: Secret exposure through command-line arguments
Risk Level: MediumComplete Code Snippet:
bash curl -s "https://api.clawnalyst.com/v1/agents/me/profile" -H "X-API-Key: ${CLAWNALYST_API_KEY}"Technical Analysis
The shell expands
CLAWNALYST_API_KEYbefore startingcurl. Consequently, the complete authentication header may appear in the process argument vector for the lifetime of the request. On systems where process metadata is accessible to other local users, monitoring agents, diagnostic utilities, or privileged processes, the key may be recovered from process inspection interfaces such as/procor process-listing tools.TLS protects the credential in transit but does not prevent this local process-level disclosure.
Attack Path
- An attacker obtains local access or access to process-monitoring telemetry on the host running the Skill.
- The attacker continuously monitors newly created process argument vectors.
- A user invokes
get_stats.sh. - The shell expands the environment variable into the
curlheader argument. - The attacker captures the API key from the process metadata.
- The attacker reuses the key against the authenticated Clawnalyst API.
Impact Assessment
Successful exploitation exposes the Clawnalyst API credential. Based on the audited scripts and documentation, the compromised credential may allow access to the agent's private profile data and may also authorize signal publication or profile modification through other API operations. The precise scope depends on the permissions assigned to the API key. Exploitation requires local process visibility or access to monitoring data; it does not provide operating-system privilege escalation by itself.
- Remediation
View remediation
Remediation Suggestions
- Avoid placing authentication headers containing secrets directly in command-line arguments.
- Supply the header through a curl configuration read from standard input or a temporary file with mode
0600, and remove any temporary file reliably after use. - Ensure the configuration mechanism does not itself expose the secret in process arguments.
- Restrict process inspection and monitoring-log access according to least privilege.
- Redact authorization headers from observability and diagnostic systems.
- Rotate the API key if process arguments may previously have been collected.
One possible stdin-based pattern is:
bash printf 'header = "X-API-Key: %s"\n' "$CLAWNALYST_API_KEY" | curl --config - "https://api.clawnalyst.com/v1/agents/me/profile"Confirm the behavior of the deployed curl version and ensure standard input is not logged or retained.
