T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/create_realtime_call.py:170
- Finding
- Credentials can be exposed through command-line arguments and plaintext configuration<![CDATA[ ## Vulnerability Details **File Location**: `scripts/create_realtime_call.py:170-171`, `scripts/create_realtime_call.py:204-205`; related workflow in `SKILL.md:10-11` **Vulnerability Type**: Credential exposure through process arguments and plaintext configuration **Risk Level**: Medium ### Complete Code Snippet ```python p.add_argument("--access-key", help="Override accessKey") p.add_argument("--secret-key", help="Override secretKey") ``` ```python access_key = get_value(config, args.access_key, "accessKey", required=True) secret_key = get_value(config, args.secret_key, "secretKey", required=True) ``` The documented workflow also directs users to place both credentials in `config.json`: ```text 1. 在 `config.json` 中配置默认参数(可参考 `config.json.example`),包括:`accessKey`、`secretKey`、`robotId`、`mobile`、`callerNum`。 ``` The distributed `config.json` contains masked placeholders rather than real credentials, so no committed live secret was identified. ### Technical Analysis The script accepts the AIOB access key and secret key directly as command-line arguments. Command-line secrets may be exposed through: - Shell history. - Process inspection tools available to other local users or monitoring agents. - Job definitions, scheduler metadata, diagnostic records, and command audit logs. - Agent or automation transcripts that preserve the invoked command. The documented alternative is to store the credentials directly in an ordinary JSON configuration file. The implementation does not enforce restrictive permissions, use a secrets manager, or separate sensitive credentials from non-sensitive call configuration. Credential transmission to `https://aiob-open.baidu.com/api/v2/getToken` is required for the declared AIOB functionality and uses HTTPS. The risk is therefore not the intended network request itself, but insecure local secret handling before that request. ### Attack Path 1. A user invokes the script with `--access-key` and `--secret-key`, or saves ...[truncated 1130 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--access-key` and `--secret-key` command-line options so secrets cannot be passed through process arguments. 2. Retrieve credentials from a dedicated operating-system secret store, cloud secrets manager, or protected runtime credential provider. 3. If environment variables must be supported, document their exposure limitations and inject them only at execution time rather than placing them in command text. 4. Move credentials out of `config.json`; retain only non-sensitive settings such as `robotId`, call defaults, and timeout values there. 5. If a credential file remains supported: - Require restrictive ownership and permissions, such as mode `0600` on Unix-like systems. - Reject files that are group- or world-readable. - Add the credential-bearing file to `.gitignore`. - Provide a placeholder-only example file under a distinct name. 6. Rotate credentials immediately if they have appeared in shell history, logs, agent transcripts, or source control. 7. Use a narrowly scoped AIOB credential where the platform supports account or API-level permission restrictions. ]]>
