T09 · Insecure Skill Coding Practices
- Location
SKILL.md:38- Finding
API Token Exposure Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:38-41; supporting implementation atscripts/publish.py:408
Vulnerability Type: Credential exposure through process arguments
Risk Level: MediumVulnerable Code
bash export CLAWHUB_TOKEN="your_API_token" python scripts/publish.py --skill ./skill-dir --slug my-skill --name "My Skill" --token "$CLAWHUB_TOKEN"python ap.add_argument("--token", default="")Technical Analysis
The documented invocation expands
CLAWHUB_TOKENinto the--tokencommand-line argument. Although the publishing function subsequently transfers this value to the child process through theCLAWHUB_TOKENenvironment variable, the Python wrapper's process arguments still contain the plaintext token.Command-line arguments may be visible through process inspection facilities, endpoint monitoring, diagnostic tooling, terminal recordings, automation logs, or shell history. This unnecessarily increases credential exposure compared with reading the token directly from the environment or a protected credential provider.
Attack Path
- A user exports a valid ClawHub API token and invokes the documented command.
- The shell expands
$CLAWHUB_TOKENinto a plaintext--tokenargument. - A local user, monitoring agent, or process-inspection tool records or reads the wrapper process's arguments.
- The exposed token is recovered from the process listing, telemetry, or command history.
- The attacker authenticates to ClawHub using the stolen token.
- The attacker performs publishing operations permitted by the compromised account.
Impact Assessment
Successful exploitation exposes the user's ClawHub API credential. The attacker may obtain the same ClawHub publishing privileges associated with that token, potentially allowing unauthorized publication or modification of Skills. The impact is limited by the permissions, lifetime, and revocation controls o ...[truncated 103 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the
--tokencommand-line option and readCLAWHUB_TOKENdirectly fromos.environ. - Update documentation to invoke the script without expanding the secret into the command line:
bash export CLAWHUB_TOKEN="your_API_token" python scripts/publish.py --skill ./skill-dir --slug my-skill --name "My Skill" - If interactive token entry is required, use Python's
getpass.getpass()so the value is not echoed or stored in arguments. - Prefer an operating-system credential store or short-lived scoped token where supported.
- Ensure credentials are never printed in standard output, standard error, exception messages, or debug logs.
- Document token rotation and immediate revocation procedures for suspected exposure.
- Remove the
