T09 · Insecure Skill Coding Practices
- Location
SKILL.md:27- Finding
Application Secret Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 27
Vulnerability Type: Credential exposure through process arguments and shell history
Risk Level: MediumVulnerable Code
bash ./scripts/go-bdisk login --app-key YOUR_APP_KEY --secret-key YOUR_SECRET_KEYTechnical Analysis
The documented login procedure instructs users to supply the Baidu application secret directly as a command-line argument. After the placeholder is replaced with a real credential, that secret may become visible through:
- Shell history files
- Process-listing and monitoring utilities
- Terminal session recording
- Command audit logs
- Automation and diagnostic logs that capture complete command lines
Although the instruction says that users should execute the login command themselves, this does not mitigate exposure caused by the command's credential transport mechanism. The referenced
./scripts/go-bdiskexecutable was not included in the supplied project, so its internal credential storage and handling could not be evaluated.Attack Path
- A user replaces
YOUR_SECRET_KEYwith a valid Baidu application secret. - The user executes the documented login command.
- The shell, operating system, or a monitoring facility records the complete command line.
- An unauthorized local user, administrator, monitoring agent, or log reader retrieves the recorded argument.
- The exposed secret may be reused wherever the corresponding Baidu application credential is accepted.
This path requires access to process information, command history, or captured logs; the audited files do not establish remote exploitation.
Impact Assessment
Successful exploitation discloses the configured Baidu application secret. An attacker could potentially impersonate the corresponding application or abuse API access associated with that credential, subject to Baidu's authentication controls and any additional credentials or authorization required.
The exact accessible ...[truncated 200 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not accept application secrets through command-line arguments.
- Prefer an interactive hidden prompt that reads the secret without echoing it.
- Alternatively, read the secret from standard input or a credential file restricted to the owning user.
- If environment variables must be supported, document their exposure risks and ensure they are not logged or inherited unnecessarily.
- Store resulting credentials or tokens using an operating-system credential store where available.
- Redact secrets from errors, diagnostics, telemetry, and structured output.
- Update the documentation with a safe pattern, such as:
bash read -s -p "Baidu application secret: " BAIDU_SECRET printf '%s' "$BAIDU_SECRET" | ./scripts/go-bdisk login \ --app-key "$BAIDU_APP_KEY" \ --secret-key-stdin unset BAIDU_SECRET- Implement and verify the corresponding
--secret-key-stdinor secure interactive-input behavior ingo-bdisk. - Advise users who followed the previous procedure to remove affected shell-history entries and rotate any credential that may have been recorded.
