T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:27
- Finding
- Lambda CLI Example Exposes Environment Variable Values Instead of Keys## Vulnerability Details **File Location**: `SKILL.md`, lines 27-32 **Vulnerability Type**: Sensitive data exposure through unsafe documentation **Risk Level**: High ### Complete Code Snippet ```markdown 2. **Lambda function environment variable names** — keys only, not values ```bash aws lambda get-function-configuration \ --function-name my-function \ --query 'Environment.Variables' \ --output json ``` ``` ### Technical Analysis The documented AWS CLI command queries `Environment.Variables`, which returns the complete Lambda environment-variable mapping, including both names and values. It does not return names only as the surrounding instruction claims. Lambda environment-variable values frequently contain database passwords, API tokens, signing secrets, connection strings, and other credentials. A user following this example could therefore export and submit plaintext secrets to the agent. This also conflicts with the skill's rules that users must not provide credentials and that raw data should contain no credentials. Although the project contains no executable code and does not directly access AWS, this unsafe command creates a credible disclosure path across the user's AWS CLI, terminal history or logs, chat interface, and downstream processing systems. ### Attack Path 1. A user follows the documented procedure to collect Lambda environment-variable names. 2. The user runs the command with AWS credentials authorized for `lambda:GetFunctionConfiguration`. 3. AWS returns the entire `Environment.Variables` object, including plaintext values. 4. The user assumes the output contains keys only and pastes it into the agent conversation. 5. Any secrets in the Lambda configuration are disclosed to unintended processing, logging, or retention boundaries. 6. Anyone who later obtains those exposed values may use them against their corresponding services until they expire or are rotated. ...[truncated 671 chars]
- Remediation
- ## Remediation Suggestions Replace the unsafe query with one that returns only environment-variable names: ```bash aws lambda get-function-configuration \ --function-name my-function \ --query 'keys(Environment.Variables)' \ --output json ``` Apply the following additional hardening measures: 1. Explicitly instruct users not to paste raw `get-function-configuration` output. 2. Require users to inspect and redact exported data locally before submission. 3. Add a warning that environment-variable values may contain active credentials. 4. Prefer examples that transform sensitive responses into key-only output at the source. 5. If raw output has already been submitted, treat all included credentials as compromised, remove the exposed data where possible, rotate each affected secret immediately, and review relevant access logs for misuse. 6. Migrate sensitive Lambda configuration values to AWS Secrets Manager or encrypted Systems Manager Parameter Store, and grant the function only the minimum permissions needed to retrieve specific secrets.
