T09 · Insecure Skill Coding Practices
- Location
scripts/setup.sh:108- Finding
BOS secrets are exposed through command-line arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup.sh:108-127; documented usage atSKILL.md:52
Vulnerability Type: Credential exposure through process arguments and shell history
Risk Level: MediumVulnerable Code
bash do_setup() { local AK="" local SK="" local ENDPOINT="" local BUCKET="" local STS_TOKEN="" while [[ $# -gt 0 ]]; do case "$1" in --ak) AK="$2"; shift 2;; --sk) SK="$2"; shift 2;; --endpoint) ENDPOINT="$2"; shift 2;; --bucket) BUCKET="$2"; shift 2;; --sts-token) STS_TOKEN="$2"; shift 2;; *) shift;; esac done if [ -z "$AK" ] || [ -z "$SK" ] || [ -z "$ENDPOINT" ] || [ -z "$BUCKET" ]; then echo "Error: missing required parameters" echo "Usage: setup.sh --ak <AK> --sk <SK> --endpoint <ENDPOINT> --bucket <BUCKET>" exit 1 fiThe Skill instructions explicitly direct users to invoke the script this way:
bash {baseDir}/scripts/setup.sh --ak "<AccessKeyId>" --sk "<SecretAccessKey>" --endpoint "<Endpoint>" --bucket "<Bucket>"Technical Analysis
The setup interface requires the long-lived SecretAccessKey and optional STS token to be supplied as command-line arguments. Quoting arguments prevents shell metacharacter interpretation, but it does not protect their confidentiality.
Depending on the operating system and execution environment, command-line arguments may be visible through process inspection facilities while the script is running. The command may also be retained in interactive shell history, terminal logs, agent execution logs, audit systems, or orchestration telemetry.
The script validates the character set of the secrets, which reduces command-injection risk, but validation does not mitigate disclosure through the invocation channel. The credential file subsequently created with mode
600is a ...[truncated 1264 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
--skand--sts-tokenfrom the recommended command-line interface. - Read secrets interactively without terminal echo, for example with
read -r -s, when an interactive terminal is available. - For noninteractive execution, accept secrets through a protected file descriptor or a credential file created with mode
600, rather than through process arguments. - If environment variables remain supported, document that they can also be exposed by debugging tools, child processes, crash reports, or misconfigured logging.
- Encourage short-lived STS credentials with a policy restricted to the required bucket, object prefixes, and operations.
- Update
SKILL.mdso examples never place real secrets directly in shell commands. - Clear temporary shell variables after setup and avoid emitting credentials in errors, debug traces, or command logging.
- Remove
