Back to skill

Security audit

Env Config Manager

Security checks for vulnerabilities and agentic risk

Overview

This skill has a legitimate environment-file purpose, but it handles secret-bearing data in ways that could expose secrets and overstates missing encryption features.

Review before installing or using this skill with real secrets. It should not be used on production .env files unless you are comfortable with commands printing raw values to logs or transcripts, and you should not rely on the advertised encryption/export features until the implementation actually provides them. Use restrictive file permissions and pinned dependencies if you proceed.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/env_manager.py:107
Finding

Plaintext Secret Disclosure Through CLI Output

Content
View full analysis
1 else ".env" env = load_env(path) for k, v in env.items(): print(f"{k}={v}") elif cmd == "switch": env_name = args[1] if len(args) > 1 else "development" env = switch_env(env_name) print(f"Switched to {env_name}") for k, v in env.items(): print(f"{k}={v}") elif cmd == "get": key = args[1] print(os.getenv(key, "")) elif cmd == "set": key, value = args[1], args[2] set_var(key, value) print(f"Set {key}={value}") ``` ```python elif cmd == "diff": f1, f2 = args[1], args[2] env1 = load_env(f1) env2 = load_env(f2) diff = diff_env(env1, env2) for k, v in diff.items(): print(f"{k}: {v['old']} -> {v['new']}") ``` ### Technical Analysis The `load`, `switch`, `get`, `set`, and `diff` commands write complete environment-variable values to standard output. Environment files routinely hold API tokens, database passwords, private endpoints, session secrets, and cloud credentials. Standard output may be retained in shell scrollback, CI/CD logs, centralized logging systems, terminal recordings, support bundles, or AI-agent transcripts. The `set` command additionally echoes a secret immediately after it is supplied. The `diff` command can disclose both the old and replacement value. No sensitivity detection, masking, confirmation prompt, or explicit secret-display option is applied. ### Attack Path 1. A user, automation system, or AI agent invokes a documented command such as `load`, `switch`, `get`, `set`, or `diff`. 2. The selected environment file or process environment contains credentials or other confidential values. 3. The command prints those values in plaintext. 4. The ...[truncated 696 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/env_manager.py:21
Finding

Environment-Variable Injection Through Unsafe Dotenv Serialization

Content
View full analysis
None: """Save environment variables to a .env file.""" with open(path, "w") as f: for key, value in data.items(): if value is not None: f.write(f"{key}={value}\n") ``` ### Technical Analysis The function constructs dotenv records by directly interpolating caller-provided keys and values. It performs no key-name validation and does not use dotenv-aware quoting or escaping. A value containing a newline can terminate its intended record and introduce an additional environment variable. A malicious key can similarly contain delimiter or control characters that change the resulting file structure. Quotes, comments, backslashes, carriage returns, and multiline content can also be interpreted differently when the file is later parsed. The injected entries become especially significant when an environment is activated through `switch_env`, which calls: ```python load_dotenv(env_file, override=True) ``` The `override=True` behavior allows values from the generated file to replace variables already present in the process environment. ### Attack Path 1. An application integrates `save_env` and passes data that is fully or partially controlled by an untrusted user, imported configuration, or external automation. 2. The attacker supplies a value such as `expected\nINJECTED_KEY=attacker-controlled-value`. 3. `save_env` writes two logical dotenv records: ```text LEGITIMATE_KEY=expected INJECTED_KEY=attacker-controlled-value ``` 4. The generated file is subsequently loaded, potentially through `switch_env`. 5. The injected variable enters the process environment and may override an existing security-sensitive setting. 6. ...[truncated 719 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/env_manager.py:21
Finding

Secret-Bearing Environment Files May Be Created With Permissive Permissions

Content
View full analysis
None: """Save environment variables to a .env file.""" with open(path, "w") as f: for key, value in data.items(): if value is not None: f.write(f"{key}={value}\n") ``` ### Technical Analysis The function creates or truncates a potentially secret-bearing environment file with the default behavior of `open()`. For a newly created file, effective permissions depend on the process umask. The function does not explicitly require owner-only access, verify the permissions of an existing target, or correct an overly permissive mode after writing. On a system with a permissive umask, a new `.env` file can be readable by members of the same group or by other local users. If the destination already exists with permissive permissions, opening it in write mode does not automatically tighten those permissions. The direct write also lacks atomic replacement. A failure while writing could leave a partially written security configuration, although the primary confirmed concern is confidentiality. ### Attack Path 1. The tool is run on a multi-user system or in a shared workspace. 2. The process has a permissive umask, or the destination file already has broad read permissions. 3. `save_env` writes credentials or tokens to that file without enforcing owner-only permissions. 4. Another local user or process with access under the resulting file mode reads the file. 5. The exposed credentials are reused against their corresponding services. ### Impact Assessment The immediate impact is local disclosure of every secret written to the affected file. No privilege escalation occurs solely from reading the file, but disclosed credentials can grant the reader ...[truncated 291 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unpinned Dependencies Installed Without Integrity Verification

Content
View full analysis
=1.0.0 PyYAML>=6.0 cryptography>=41.0.0 click>=8.0.0 pytest>=7.0.0 ``` The documented installation command in `README.md:18-20` is: ```bash # Install pip install -r requirements.txt ``` ### Technical Analysis Every dependency uses an open-ended lower-bound constraint. Consequently, installations performed at different times may resolve to materially different package versions. No lock file or cryptographic hashes are supplied to authenticate the exact artifacts expected by the project. This is not evidence that any currently named package is malicious. The weakness is that the project does not constrain installations to reviewed versions or verify package integrity. A future compromised, unexpectedly incompatible, or maliciously replaced release satisfying the version range could be selected automatically. The file also mixes the testing dependency `pytest` with runtime dependencies, unnecessarily increasing the package set installed in production contexts. ### Attack Path 1. A user follows the documented `pip install -r requirements.txt` procedure. 2. The package resolver selects the newest available versions satisfying the open-ended constraints. 3. A selected release has been compromised, tampered with upstream, or contains a newly introduced vulnerability. 4. Package installation or later import executes or exposes the affected dependency code in the user's environment. 5. The resulting impact occurs with the privileges of the user or automation account running the installation or application. ### Impact Assessment The potential impact is determined by the behavior of a compromised dependency and the privileges of the installation process. It could range from application failure to access to project files, environment variab ...[truncated 314 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (34)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 9)May include surrounding context.

md
## Features

- **.env File Management**: Load, edit, save `.env` and `.env.*` files
- **Multi-Environment**: Switch between dev/staging/production configs instantly
- **Secret Encryption**: AES-256-GCM encryption for sensitive values
- **Schema Validation**: Validate required variables and their types

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 66)May include surrounding context.

md
## Features

- **.env File Management**: Load, edit, save `.env` and `.env.*` files
- **Multi-Environment**: Switch between dev/staging/production configs instantly
- **Secret Encryption**: AES-256-GCM encryption for sensitive values
- **Schema Validation**: Validate required variables and their types

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 45)May include surrounding context.

md
## Features

- **.env File Management**: Load, edit, save `.env` and `.env.*` files
- **Multi-Environment**: Switch between dev/staging/production configs instantly
- **Secret Encryption**: AES-256-GCM encryption for sensitive values
- **Schema Validation**: Validate required variables and their types

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · examples/basic_usage.py (reported line 13)May include surrounding context.

python
## Features

- **.env File Management**: Load, edit, save `.env` and `.env.*` files
- **Multi-Environment**: Switch between dev/staging/production configs instantly
- **Secret Encryption**: AES-256-GCM encryption for sensitive values
- **Schema Validation**: Validate required variables and their types

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · examples/basic_usage.py (reported line 14)May include surrounding context.

python
## Features

- **.env File Management**: Load, edit, save `.env` and `.env.*` files
- **Multi-Environment**: Switch between dev/staging/production configs instantly
- **Secret Encryption**: AES-256-GCM encryption for sensitive values
- **Schema Validation**: Validate required variables and their types

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/env_manager.py (reported line 15)May include surrounding context.

python
## Features

- **.env File Management**: Load, edit, save `.env` and `.env.*` files
- **Multi-Environment**: Switch between dev/staging/production configs instantly
- **Secret Encryption**: AES-256-GCM encryption for sensitive values
- **Schema Validation**: Validate required variables and their types

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/env_manager.py (reported line 22)May include surrounding context.

python
## Features

- **.env File Management**: Load, edit, save `.env` and `.env.*` files
- **Multi-Environment**: Switch between dev/staging/production configs instantly
- **Secret Encryption**: AES-256-GCM encryption for sensitive values
- **Schema Validation**: Validate required variables and their types

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/env_manager.py (reported line 44)May include surrounding context.

python
## Features

- **.env File Management**: Load, edit, save `.env` and `.env.*` files
- **Multi-Environment**: Switch between dev/staging/production configs instantly
- **Secret Encryption**: AES-256-GCM encryption for sensitive values
- **Schema Validation**: Validate required variables and their types

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · examples/basic_usage.py (reported line 66)May include surrounding context.

python
def example_switch():
    """Switch between environment files."""
    # Create dev and prod env files
    save_env({"API_URL": "http://localhost:3000", "DEBUG": "true"}, ".env.development")
    save_env({"API_URL": "https://api.example.com", "DEBUG": "false"}, ".env.production")
    
    # Switch to production

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · examples/basic_usage.py (reported line 75)May include surrounding context.

python
def example_switch():
    """Switch between environment files."""
    # Create dev and prod env files
    save_env({"API_URL": "http://localhost:3000", "DEBUG": "true"}, ".env.development")
    save_env({"API_URL": "https://api.example.com", "DEBUG": "false"}, ".env.production")
    
    # Switch to production

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · examples/basic_usage.py (reported line 67)May include surrounding context.

python
"""Switch between environment files."""
    # Create dev and prod env files
    save_env({"API_URL": "http://localhost:3000", "DEBUG": "true"}, ".env.development")
    save_env({"API_URL": "https://api.example.com", "DEBUG": "false"}, ".env.production")
    
    # Switch to production
    env = switch_env("production")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · examples/basic_usage.py (reported line 76)May include surrounding context.

python
"""Switch between environment files."""
    # Create dev and prod env files
    save_env({"API_URL": "http://localhost:3000", "DEBUG": "true"}, ".env.development")
    save_env({"API_URL": "https://api.example.com", "DEBUG": "false"}, ".env.production")
    
    # Switch to production
    env = switch_env("production")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

md
import yaml


def load_env(path: str = ".env") -> Dict[str, Optional[str]]:
    """Load environment variables from a .env file."""
    if not os.path.exists(path):
        return {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/env_manager.py (reported line 14)May include surrounding context.

python
import yaml


def load_env(path: str = ".env") -> Dict[str, Optional[str]]:
    """Load environment variables from a .env file."""
    if not os.path.exists(path):
        return {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/env_manager.py (reported line 21)May include surrounding context.

python
import yaml


def load_env(path: str = ".env") -> Dict[str, Optional[str]]:
    """Load environment variables from a .env file."""
    if not os.path.exists(path):
        return {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/env_manager.py (reported line 43)May include surrounding context.

python
import yaml


def load_env(path: str = ".env") -> Dict[str, Optional[str]]:
    """Load environment variables from a .env file."""
    if not os.path.exists(path):
        return {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/env_manager.py (reported line 108)May include surrounding context.

python
import yaml


def load_env(path: str = ".env") -> Dict[str, Optional[str]]:
    """Load environment variables from a .env file."""
    if not os.path.exists(path):
        return {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/test_env_manager.py (reported line 18)May include surrounding context.

python
import yaml


def load_env(path: str = ".env") -> Dict[str, Optional[str]]:
    """Load environment variables from a .env file."""
    if not os.path.exists(path):
        return {}

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This is a markdown file, so SQP-2 applies to omissions in user-facing safety disclosures. The description and API reference advertise handling .env files, secrets, decryption, rotation, and save(path) writes, but there is no warning about modifying sensitive files, safeguarding encryption keys, or avoiding accidental secret exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The CLI prints all key/value pairs from environment files directly to stdout, which commonly exposes secrets such as API keys, database passwords, and tokens. In developer tooling, stdout is often captured in shell history, CI logs, terminal recordings, or support transcripts, so unmasked secret disclosure is a real confidentiality risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The get command prints the requested environment variable value directly, which can disclose sensitive runtime secrets with no masking or confirmation. Even if the caller supplies the key intentionally, the tool increases the chance of accidental leakage into logs and terminal history.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This markdown file documents commands that encrypt, decrypt, and export environment secrets, which can affect sensitive data and privacy. The README explains functionality but does not include any warning or caution about protecting decrypted output, exported bundles, or production secrets.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

SQP-3 covers natural-language policy violations such as forcing a specific language without opt-in. Although the file includes both English and Chinese, it does not state whether multilingual output is optional or user-selected, so there is a mild risk of implicit locale behavior.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This weakens build reproducibility and makes it difficult to verify whether a deployed version includes known security fixes or introduces a vulnerable release.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
python-dotenv>=1.0.0
PyYAML>=6.0
cryptography>=41.0.0
click>=8.0.0

Unverifiable Dependency: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
92% confidence
Finding

python-dotenv has known advisories, but because the manifest does not pin a specific version, there is no way to confirm whether the installed release is affected. This uncertainty is itself a supply-chain risk because different environments may resolve to vulnerable versions without visibility.

Content

No source excerpt is available for this finding.