T09 · Insecure Skill Coding Practices
- Location
SKILL.md:109- Finding
Access Token Exposed Through Process Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 109–116; the same pattern recurs at lines 157–162, 181, 193, 199, 216–224, and 236–242
Vulnerability Type: Credential exposure through process arguments
Risk Level: MediumVulnerable Code Snippet
bash # Read the access_token field from .kjlconfig.json into TOKEN before execution. node SCRIPT_PATH --token=$TOKEN --version=1.0.0Other documented invocations repeat the same unsafe credential-passing pattern:
bash node SCRIPT_PATH --token=$TOKEN --designId=$DESIGN_ID node SCRIPT_PATH --obsDesignId=$DESIGN_ID --xToken=$TOKENSCRIPT_PATHrepresents the script placeholder used by the original document; no actual scripts are included in the audited package.Technical Analysis
The skill directs the Agent to read the Kujiale bearer token from a plaintext configuration file and expand it into command-line arguments such as
--tokenand--xToken.Command-line arguments are not an appropriate secret transport mechanism. Depending on the host and Agent platform, expanded arguments can appear in:
- Process inspection interfaces and process listings.
- Agent tool-call and command-execution traces.
- Terminal transcripts or shell debugging output.
- Audit, telemetry, crash, or error logs.
- Process-monitoring and endpoint-management products.
Quoting the token would not resolve the exposure because quoting only changes shell parsing; the expanded secret remains in the child process argument vector.
Attack Path
- A user stores a valid Kujiale access token in
.kjlconfig.jsonas directed. - The Agent reads the token into the
TOKENshell variable. - The Agent executes one of the documented commands using
--token=$TOKENor--xToken=$TOKEN. - The shell expands the variable before starting the Node.js process.
- The complete token becomes part of the process argument vector and may also be captured by Age ...[truncated 828 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
--tokenand--xTokenfrom every documented command. - Have scripts read the credential directly from a protected environment variable or secret manager without copying it into the argument vector.
- Where environment exposure is also a concern, pass the token through a dedicated inherited file descriptor or standard input, provided the script does not log it.
- Configure the Agent and scripts to redact token values from command traces, errors, telemetry, and HTTP logs.
- Store
.kjlconfig.jsonwith owner-only permissions and validate those permissions before use. - Add
.kjlconfig.jsonto.gitignoreand provide only a placeholder example file. - Avoid printing request headers, complete API responses containing credentials, or expanded command strings.
- Use short-lived, narrowly scoped tokens where the Kujiale API supports them, and provide a documented revocation procedure.
- Rotate any token that may already have appeared in command logs or process-monitoring records.
- Remove
