Back to skill

Security audit

credential-exposure-map

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marked this skill suspicious because it reports broad searches for credentials and agent configuration, while the scan was partial and found a gap in its Git history coverage.

Treat this as a review decision and weigh the broad access to environment variables, credential files, and MCP configuration before installing. The scan inspected 75% of components; obfuscated text could not be fully evaluated, several static analyzers were degraded, and a referenced state file was missing. The Git scan may also miss secrets beyond the first 50 commits.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

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 108)May include surrounding context.

md
|--------|--------------|
| Environment variables | API keys, tokens, passwords in process.env |
| openclaw.json | Provider keys, webhook secrets, MCP auth |
| .env files | Any .env in workspace or ~/.openclaw |
| MEMORY.md / memory/*.md | Credentials written into agent memory |
| memory/*.json | Credential caches, state files with tokens |
| Installed skills | Skills with exec, read, or network capabilities |

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 108)May include surrounding context.

md
|--------|--------------|
| Environment variables | API keys, tokens, passwords in process.env |
| openclaw.json | Provider keys, webhook secrets, MCP auth |
| .env files | Any .env in workspace or ~/.openclaw |
| MEMORY.md / memory/*.md | Credentials written into agent memory |
| memory/*.json | Credential caches, state files with tokens |
| Installed skills | Skills with exec, read, or network capabilities |

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/scan_exposure.py (reported line 104)May include surrounding context.

python
def scan_env_files():
    """Scan .env files for credentials."""
    findings = []
    search_paths = [
        os.path.join(WORKSPACE, ".env"),

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/scan_exposure.py (reported line 48)May include surrounding context.

python
def scan_env_vars():
    """Scan process.env for credential-like variables."""
    findings = []
    for key, value in os.environ.items():
        key_upper = key.upper()
        is_secret_name = any(s in key_upper for s in ENV_SECRET_NAMES)
        looks_like_secret = len(value) > 12 and bool(re.match(r'^[a-zA-Z0-9/+=_-]+$', value))

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/scan_exposure.py (reported line 107)May include surrounding context.

python
"""Scan .env files for credentials."""
    findings = []
    search_paths = [
        os.path.join(WORKSPACE, ".env"),
        os.path.join(WORKSPACE, ".env.local"),
        os.path.join(OPENCLAW_DIR, ".env"),
    ]

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/scan_exposure.py (reported line 108)May include surrounding context.

python
findings = []
    search_paths = [
        os.path.join(WORKSPACE, ".env"),
        os.path.join(WORKSPACE, ".env.local"),
        os.path.join(OPENCLAW_DIR, ".env"),
    ]
    search_paths += glob.glob(os.path.join(WORKSPACE, ".env*"))

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/scan_exposure.py (reported line 109)May include surrounding context.

python
search_paths = [
        os.path.join(WORKSPACE, ".env"),
        os.path.join(WORKSPACE, ".env.local"),
        os.path.join(OPENCLAW_DIR, ".env"),
    ]
    search_paths += glob.glob(os.path.join(WORKSPACE, ".env*"))

MCP Config Access

High
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · scripts/scan_exposure.py (reported line 249)May include surrounding context.

python
def scan_mcp_servers():
    """List MCP servers from config."""
    findings = []
    if not os.path.exists(CONFIG_PATH):
        return findings

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/scan_exposure.py (reported line 325)May include surrounding context.

python
scanners = [
        ("Environment Variables", scan_env_vars),
        ("OpenClaw Config", scan_config),
        (".env Files", scan_env_files),
        ("Memory Files (MD)", scan_memory_files),
        ("Memory Files (JSON)", scan_memory_json),
        ("Installed Skills", scan_skills),

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · scripts/scan_exposure.py (reported line 104)May include surrounding context.

python
def scan_env_files():
    """Scan .env files for credentials."""
    findings = []
    search_paths = [
        os.path.join(WORKSPACE, ".env"),

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · scripts/scan_exposure.py (reported line 111)May include surrounding context.

python
os.path.join(WORKSPACE, ".env.local"),
        os.path.join(OPENCLAW_DIR, ".env"),
    ]
    search_paths += glob.glob(os.path.join(WORKSPACE, ".env*"))
    
    seen = set()
    for path in search_paths:

Git scanner documents 200-commit coverage but checks only 50 commits for secrets (L279–L294).

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The function claims 200-commit coverage, but discards that listing and examines patches from only 50 commits, leaving older credentials undetected. This can create false assurance during remediation, although the skill's separate documentation correctly states the 50-commit limit.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/scan_exposure.py (reported line 285)May include surrounding context.

python
return findings
    
    try:
        result = subprocess.run(
            ["git", "-C", WORKSPACE, "log", "--oneline", "-200", "--all"],
            capture_output=True, text=True, timeout=10
        )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/scan_exposure.py (reported line 290)May include surrounding context.

python
capture_output=True, text=True, timeout=10
        )
        # Check diffs for secrets in last 50 commits
        result = subprocess.run(
            ["git", "-C", WORKSPACE, "log", "-50", "--patch", "--format=", "--all"],
            capture_output=True, text=True, timeout=15
        )