T09 · Insecure Skill Coding Practices
- Location
scripts/chat.py:357- Finding
Tencent Cloud credentials exposed through command-line arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/chat.py:357-358
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: MediumThe documented usage in
SKILL.md:68-69,SKILL.md:75-76, andSKILL.md:87-88instructs users to supply the same credentials through command-line options.python p.add_argument("--secret-id", default="", help="TencentCloud SecretId") p.add_argument("--secret-key", default="", help="TencentCloud SecretKey")A representative documented invocation is:
bash python3 scripts/chat.py --instance-id $INSTANCE_ID --secret-id $SECRET_ID --secret-key $SECRET_KEY \ --message "hello"Technical Analysis
The client accepts long-lived Tencent Cloud credentials directly through command-line arguments. After shell variable expansion, the actual credential values become part of the process argument vector.
Depending on the operating system and execution environment, command-line arguments can be exposed through process inspection facilities, monitoring agents, diagnostic tooling, command auditing, job runners, or shell-history practices. Although the secret key is used locally to derive a TC3 signature and is not directly transmitted to Tencent Cloud, accepting it through the command line unnecessarily increases its local exposure.
The network authentication itself is consistent with the declared functionality: requests are signed locally and sent over HTTPS to the documented Tencent Cloud endpoints. The weakness is specifically the credential input mechanism.
Attack Path
- A user follows the documented command and supplies
--secret-idand--secret-key, directly or through expanded shell variables. - The shell places the expanded credential values in the process argument vector.
- A local user, monitoring service, CI/CD log collector, diagnostic utility, or other component capable of observing process commands records or reads ...[truncated 1075 chars]
- A user follows the documented command and supplies
- Remediation
View remediation
Remediation Suggestions
- Remove command-line options for secret values, or retain them only as a deprecated fallback accompanied by a prominent warning.
- Load credentials from a supported Tencent Cloud credential provider, protected environment variables, or a credentials file with restrictive filesystem permissions.
- For interactive execution, use
getpass.getpass()so the secret is not echoed or placed in the process argument vector. - Update all examples in
SKILL.mdto avoid passing secrets through--secret-idand--secret-key. - Recommend short-lived credentials or role-based credentials rather than long-lived access keys.
- Apply least-privilege IAM policies so credentials used by this client can invoke only the required DatabaseClaw actions and resources.
- Ensure exception messages and verbose output never include credentials or complete authorization headers.
- Rotate any credentials that may already have been exposed through process logs, shell history, CI/CD logs, or monitoring systems.
