T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:20
- Finding
- Reusable Account Credentials Exported to All Child Processes<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 20-22 **Vulnerability Type**: Sensitive credential exposure through inherited environment variables **Risk Level**: Medium ### Code Snippet ```sh export MHLB_USER='you@example.com' export MHLB_PASS='…' # e.g. read -rs MHLB_PASS export MHLB=https://ordernow.myhotlunchbox.com ``` ### Technical Analysis The username and password only need to be shell-local variables so that `mhlb_login` can expand them into the authentication request. Exporting `MHLB_USER` and `MHLB_PASS` causes every subsequently launched child process to inherit the reusable credentials. This exceeds the minimum privilege required for authentication. Unrelated subprocesses, compromised command-line utilities, debugging tools, crash-reporting systems, or process-inspection mechanisms may be able to read the inherited environment. Unlike the short-lived access token, the password can generally be reused to create new sessions. The HTTPS transmission of these credentials to the declared My Hot Lunchbox authentication endpoint is necessary for the Skill's stated functionality. The local export to all child processes is not necessary. ### Attack Path 1. A user follows the documented setup and exports `MHLB_USER` and `MHLB_PASS`. 2. The user subsequently launches an unrelated or compromised process from the same shell. 3. That process reads its inherited environment and extracts the two variables. 4. The attacker authenticates to the My Hot Lunchbox service using the reusable credentials. 5. The attacker accesses or modifies resources available to the compromised account. ### Impact Assessment A process that captures the credentials may obtain the same remote privileges as the account owner. Depending on account permissions, this can expose student identities, school details, lunch calendars, order records, transaction information, subscriptions, gift cards, and coupons. It may also permit account and order mut ...[truncated 233 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions Keep credentials in non-exported shell variables and remove the password as soon as authentication completes: ```sh MHLB_USER='you@example.com' MHLB=https://ordernow.myhotlunchbox.com read -rs MHLB_PASS printf '\n' >&2 mhlb_login login_status=$? unset MHLB_PASS return "$login_status" ``` Additional hardening measures: - Do not place the password in shell startup files or persistent environment configuration. - Avoid passing the password as a command-line argument. - Limit the password's lifetime in memory by unsetting it immediately after login. - Consider accepting the password through standard input or a narrowly scoped credential helper. - Remove the unused `offline_access` OAuth scope unless refresh-token functionality is actually required. ]]>
