T09 · Insecure Skill Coding Practices
- Location
scripts/run.py:187- Finding
API Credential Exposure Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/run.py:187
Additional Documentation Location:SKILL.md:81,SKILL.md:143
Vulnerability Type: Insecure credential handling
Risk Level: MediumVulnerable Code
python parser.add_argument("--appkey", required=True, help="内部医疗大模型鉴权key(必填)")The documented invocation also instructs users to place the credential directly in the command:
bash python3 scripts/run.py --input input.json --output output.json --appkey YOUR_KEYTechnical Analysis
The application requires the bearer credential to be supplied as a command-line argument. Command-line arguments may be exposed through:
- Operating-system process listings such as
ps. - Shell history files.
- Process monitoring and observability systems.
- CI/CD job logs.
- Container or workload metadata.
- Diagnostic reports that capture process arguments.
HTTPS protects the credential while it is transmitted to the API, but it does not mitigate disclosure through local process metadata or command history.
Attack Path
- A user follows the documented invocation and passes a valid credential using
--appkey. - The shell records the command in its history, or the operating system exposes it in the process argument list while the program is running.
- A local user, administrator, monitoring service, or party with access to execution logs reads the argument.
- The party extracts the credential and submits unauthorized requests to the medical-model API.
Impact Assessment
Exploitation does not directly grant operating-system privileges. It can grant access equivalent to the compromised API credential, including unauthorized consumption of API quota, submission of model requests, and access to any capabilities associated with that credential.
The impact is limited by the permissions, expiration, rate limits, and billing scope assigned to the exposed credential.
- Operating-system process listings such as
- Remediation
View remediation
Remediation Suggestions
- Read the credential from a protected environment variable or operating-system secret store rather than a command-line argument.
- Support secure standard-input entry, preferably without terminal echo, for interactive execution.
- Integrate with the deployment platform's native secret-management mechanism.
- Remove the credential-bearing command example from
SKILL.md. - If
--appkeymust remain for backward compatibility, clearly mark it as deprecated and insecure. - Ensure application and orchestration logs redact authorization credentials.
- Use short-lived, narrowly scoped credentials and provide a rotation procedure.
