T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:179
- Finding
- Authentication Token Exposure Through Process Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:179`, `SKILL.md:246-249`, `scripts/issue.py:150`, `scripts/query.py:144` **Vulnerability Type**: Authentication token disclosure through process arguments **Risk Level**: Medium ### Vulnerable Code ```bash ISSUE_RESULT=$($PYTHON "$ISSUE_SCRIPT" --token "$USER_TOKEN" --phone-masked "$PHONE_MASKED") ``` ```bash QUERY_RESULT=$($PYTHON "$QUERY_SCRIPT" --token "$USER_TOKEN" --dates "20260323") QUERY_RESULT=$($PYTHON "$QUERY_SCRIPT" --token "$USER_TOKEN" --dates "20260320,20260323") ``` ```python # scripts/issue.py parser.add_argument("--token", required=True, help="User user_token") parser.add_argument("--phone-masked", required=True, help="Masked phone number used to generate redeem_code") ``` ```python # scripts/query.py parser.add_argument("--token", required=True, help="User user_token") parser.add_argument( "--dates", required=True, help="Query date, such as 20260323, or range, such as 20260320,20260323" ) ``` ### Technical Analysis The Skill transfers a reusable Meituan session token between processes using a command-line argument. Command-line arguments are not an appropriate secret transport mechanism because they may be visible through: - Process inspection utilities available to other local processes under applicable operating-system permissions. - Agent execution traces and tool-call records. - Shell debugging or tracing facilities. - Endpoint monitoring, audit, or process telemetry. - Error reports that record the executed command. Quoting the variable prevents shell word splitting but does not conceal the value from process metadata or logging. The token is already stored in a permission-restricted authentication file, so exposing it again through the command line exceeds the minimum data exposure necessary for coupon issuance and history queries. ### Attack Path 1. The user authenticates successfully, and the Skill obtains a valid `user_token`. 2. The Agent invokes ` ...[truncated 758 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove the `--token` argument from `issue.py` and `query.py`. - Have the scripts load the token directly from the existing authentication file after verifying its ownership and restrictive permissions. - Alternatively, pass the token over standard input or through a dedicated inherited file descriptor. - Ensure Agent tool output, command telemetry, and error messages redact authentication tokens. - Avoid environment variables for long-lived secrets where process-environment inspection is possible. - Rotate or invalidate tokens that may already have been exposed through historical execution logs. ]]>
