Back to skill

Security audit

Env Tool

Security checks for vulnerabilities and agentic risk

Overview

This skill is a small environment-variable viewer, but its default use prints every environment variable value, which can expose secrets without warning.

Install only if you are comfortable with a tool that can print raw environment values into terminal output, agent transcripts, or logs. Prefer using it only for specific non-sensitive variables, and avoid running the default all-variable listing in environments that may contain credentials or tokens.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/env.py:8
Finding

Unrestricted Disclosure of Sensitive Environment Variables

Content
View full analysis

Vulnerability Details

File Location: scripts/env.py:8-11
Related Documentation: SKILL.md:16-17, SKILL.md:23-24
Vulnerability Type: Sensitive environment-variable exposure
Risk Level: Medium

Vulnerable Code

python
if args.var:
    print(os.environ.get(args.var, ''))
else:
    for k, v in sorted(os.environ.items()):
        print(f"{k}={v}")

The documented default usage explicitly invokes this unrestricted behavior:

markdown
- List all environment variables with values
bash
# List all environment variables
env-tool

Technical Analysis

When invoked without an argument, the script enumerates the complete inherited process environment and prints every variable name and raw value. It does not apply secret-name filtering, value redaction, access confirmation, or an explicit opt-in requirement.

Environment variables in agent, development, container, and CI/CD environments frequently hold API keys, access tokens, passwords, signing credentials, cloud credentials, and internal service configuration. Printing these values can place them in terminal history, agent context, execution transcripts, CI logs, or any system collecting standard output.

The project contains no network request or direct exfiltration mechanism. Consequently, this finding concerns local disclosure through output rather than demonstrated transmission to an external party.

Attack Path

  1. A user or agent follows the documented example and invokes env-tool without a variable name.
  2. The script enters the else branch and calls os.environ.items().
  3. Every inherited environment variable is formatted as NAME=value.
  4. Secret-bearing values are written in plaintext to standard output.
  5. The output may subsequently be retained in agent conversations, CI logs, terminal recordings, monitoring systems, or other downstream output consumers.
  6. Any party able to access those records may recover the exposed credentials and use them wi ...[truncated 585 chars]
Remediation
View remediation

Remediation Suggestions

  1. Make variable names without values the default output for bulk enumeration.
  2. Require an explicit option such as --show-values before printing any values.
  3. Require additional confirmation before displaying all values in an interactive session.
  4. Redact variables whose names indicate sensitive content, including names containing TOKEN, SECRET, PASSWORD, PASS, KEY, CREDENTIAL, AUTH, or COOKIE.
  5. Prefer an allowlist of variables that are safe to display rather than relying only on a denylist.
  6. Preserve targeted lookup as the primary workflow, but warn users when requesting a likely sensitive variable.
  7. Update SKILL.md so it does not recommend unrestricted value enumeration.
  8. Avoid writing unredacted environment output to logs, agent context, telemetry, or persistent execution records.

A safer default implementation would resemble:

python
if args.var:
    value = os.environ.get(args.var, '')
    print(value)
else:
    for key in sorted(os.environ):
        print(key)

Bulk value display, if retained, should be placed behind a clearly named explicit option and should redact likely secrets.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description says the skill can display, set, and manage environment variables. However, the supplied code only supports inspection/display of environment variables via os.environ and does not implement any ability to set, modify, or otherwise manage them. The primary purpose is partially aligned (displaying environment variables), but the broader declared capability to modify the runtime environment is not represented in the code.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
97% confidence
Finding

Iterating over os.environ.items() and printing every key/value pair enables bulk harvesting of all environment-resident secrets in the runtime. In the context of an agent skill, this is more dangerous because agent environments often contain service credentials, API tokens, and infrastructure configuration that can be exfiltrated in a single command.

Content

Scanner excerpt · scripts/env.py (reported line 10)May include surrounding context.

python
if args.var:
    print(os.environ.get(args.var, ''))
else:
    for k, v in sorted(os.environ.items()):
        print(f"{k}={v}")

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises capability to inspect and modify environment variables, which can expose sensitive runtime secrets such as API keys, tokens, and credentials. Omitting an explicit tool scope or permissions declaration makes the access boundary unclear and increases the chance the skill is invoked with broader environment access than intended.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly supports listing all environment variables and showing specific values without any warning about secret exposure. In real environments, variables frequently contain credentials, access tokens, internal endpoints, and other sensitive data, so encouraging unrestricted output can directly leak secrets into logs, transcripts, or downstream tools.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script prints either a requested environment variable or the entire process environment with no warning, filtering, or access control. Environment variables commonly contain secrets such as API keys, tokens, credentials, and internal endpoints, so this can expose sensitive data to users or downstream logs.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes broader functionality including setting and managing environment variables in shell sessions. This script only supports listing all environment variables or displaying a single variable's value, with no code to modify, unset, or otherwise manage them.

Content

No source excerpt is available for this finding.