T09 · Insecure Skill Coding Practices
- Location
- SKILL.md:28
- Finding
- Unsafe Private-Key Configuration Guidance## Vulnerability Details **File Location**: `SKILL.md:28-35` **Vulnerability Type**: Plaintext secret exposure through insecure configuration guidance **Risk Level**: Medium ### Vulnerable Code ```bash Set these environment variables or edit the scripts: export STAKINGVERSE_VAULT="0x9F49a95b0c3c9e2A6c77a16C177928294c0F6F04" export MY_UP="your_universal_profile_address" export CONTROLLER="your_controller_address" export PRIVATE_KEY="your_controller_private_key" export RPC_URL="https://rpc.mainnet.lukso.network" ``` ### Technical Analysis The documentation explicitly permits users to edit the scripts to provide configuration values, including the controller's private key. Embedding a private key in source code places a high-value credential in a file that may subsequently be committed to version control, copied into archives, uploaded for support, cached by development tools, or distributed with the skill. The scripts use this credential to instantiate an `ethers.Wallet` capable of signing blockchain transactions. Consequently, disclosure is not limited to account identification: it exposes all transaction authority granted to that controller. The environment-variable alternative is safer than source embedding but still leaves the key accessible to the process and potentially to process inspection, crash diagnostics, or insecure shell history. The documentation does not recommend a secret manager, hardware-backed signer, or restricted credential lifecycle. ### Attack Path 1. A user follows the instruction allowing configuration values to be inserted directly into the scripts. 2. The user places the controller private key in a project file. 3. The modified project is committed, archived, uploaded, shared, or otherwise exposed. 4. An attacker retrieves the plaintext private key. 5. The attacker imports the key into a wallet or signing program. 6. The attacker submits any transaction permitted by that controller, ...[truncated 483 chars]
- Remediation
- ## Remediation Suggestions - Remove the phrase permitting users to edit scripts with configuration values. - Explicitly prohibit storing private keys in source files, repositories, shell history, logs, or project archives. - Use a dedicated secret manager, encrypted keystore, hardware wallet, or external signing service. - If environment variables must be supported, document their residual exposure risks and recommend short-lived, least-privileged controller keys. - Validate that the controller has only the minimum permissions required for staking, withdrawal, and claim operations. - Add secret-scanning controls such as pre-commit hooks and CI checks. - Document an immediate key-revocation and rotation procedure for accidental exposure.
