Back to skill

Security audit

Security Hardener

Security checks for vulnerabilities and agentic risk

Overview

This OpenClaw hardening skill has a coherent security-audit purpose, but it reads broad sensitive local files and overstates some checks, so it should be reviewed before installation.

Install only if you are comfortable letting it read OpenClaw config, workspace, memory, and home .env files. Prefer running audit/report first, review the scan scope, use --dry-run before fix, and do not rely on its CVE or auth results as complete without an independent check.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (3)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/security-hardener.py:503
Finding

Broad Collection of Sensitive Workspace, Memory, and Environment Files

Content
View full analysis
2 * 1024 * 1024: # 2MB limit continue try: with open(fpath, 'r', errors='ignore') as f: content = f.read() scanned += 1 except (IOError, PermissionError): continue for pattern, name in SECRET_PATTERNS: matches = re.findall(pattern, content) if matches: # Don't include the actual key in the finding rel_path = os.path.relpath(fpath, os.path.expanduser('~')) findings.append(Finding( 'secrets', 'critical' if 'live' in name.lower() or 'private' in name.lower() else 'high', f'Exposed {name} in ~/{rel_path}', f'Found {len(matches)} match(es) for {name} pattern in file.', fix=f'Move secrets to environment variables or .env file. Remove from {rel_path}.', auto_fixable=False, )) ``` ```python def cmd_keys(args): """Scan for exposed API keys.""" pr ...[truncated 2686 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/security-hardener.py:375
Finding

Advertised CVE Audit Does Not Perform Vulnerable-Version Evaluation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/security-hardener.py:147
Finding

Incomplete Authentication Validation Can Report an Unprotected Gateway as Secure

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (25)

Credential Access

High
Category
Privilege Escalation
Confidence
79% confidence
Finding

The skill explicitly scans highly sensitive sources including .env files, shell history, memory files, and git history for credentials. While aligned with a security-audit purpose, this is still credential-access behavior and becomes dangerous if outputs are over-collected, logged, or exposed to an untrusted context.

Content

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

md
Options: `--dry-run` to preview fixes without applying, `--backup-dir <path>`.

### `keys` — API Key Scanner
Searches config files, memory files, SKILL.md files, .env files, shell history, and git history for exposed secrets. Pattern library covers 40+ key formats (AWS, OpenAI, Anthropic, Stripe, etc.).

### `auth` — Auth Configuration Check
Verifies authentication is properly configured:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/security-hardener.py (reported line 40)May include surrounding context.

python
(r'sk-ant-[a-zA-Z0-9\-]{20,}', 'Anthropic API Key'),
    (r'AKIA[0-9A-Z]{16}', 'AWS Access Key'),
    (r'AIza[0-9A-Za-z\-_]{35}', 'Google API Key'),
    (r'ghp_[a-zA-Z0-9]{36}', 'GitHub Personal Access Token'),
    (r'gho_[a-zA-Z0-9]{36}', 'GitHub OAuth Token'),
    (r'glpat-[a-zA-Z0-9\-]{20,}', 'GitLab Personal Access Token'),
    (r'xoxb-[0-9]{10,}-[0-9]{10,}-[a-zA-Z0-9]{24,}', 'Slack Bot Token'),

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/security-hardener.py (reported line 42)May include surrounding context.

python
(r'sk-ant-[a-zA-Z0-9\-]{20,}', 'Anthropic API Key'),
    (r'AKIA[0-9A-Z]{16}', 'AWS Access Key'),
    (r'AIza[0-9A-Za-z\-_]{35}', 'Google API Key'),
    (r'ghp_[a-zA-Z0-9]{36}', 'GitHub Personal Access Token'),
    (r'gho_[a-zA-Z0-9]{36}', 'GitHub OAuth Token'),
    (r'glpat-[a-zA-Z0-9\-]{20,}', 'GitLab Personal Access Token'),
    (r'xoxb-[0-9]{10,}-[0-9]{10,}-[a-zA-Z0-9]{24,}', 'Slack Bot Token'),

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

python
(r'sk-ant-[a-zA-Z0-9\-]{20,}', 'Anthropic API Key'),
    (r'AKIA[0-9A-Z]{16}', 'AWS Access Key'),
    (r'AIza[0-9A-Za-z\-_]{35}', 'Google API Key'),
    (r'ghp_[a-zA-Z0-9]{36}', 'GitHub Personal Access Token'),
    (r'gho_[a-zA-Z0-9]{36}', 'GitHub OAuth Token'),
    (r'glpat-[a-zA-Z0-9\-]{20,}', 'GitLab Personal Access Token'),
    (r'xoxb-[0-9]{10,}-[0-9]{10,}-[a-zA-Z0-9]{24,}', 'Slack Bot Token'),

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/security-hardener.py (reported line 52)May include surrounding context.

python
(r'sk-ant-[a-zA-Z0-9\-]{20,}', 'Anthropic API Key'),
    (r'AKIA[0-9A-Z]{16}', 'AWS Access Key'),
    (r'AIza[0-9A-Za-z\-_]{35}', 'Google API Key'),
    (r'ghp_[a-zA-Z0-9]{36}', 'GitHub Personal Access Token'),
    (r'gho_[a-zA-Z0-9]{36}', 'GitHub OAuth Token'),
    (r'glpat-[a-zA-Z0-9\-]{20,}', 'GitLab Personal Access Token'),
    (r'xoxb-[0-9]{10,}-[0-9]{10,}-[a-zA-Z0-9]{24,}', 'Slack Bot Token'),

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/security-hardener.py (reported line 202)May include surrounding context.

python
if os.path.isdir(path):
            files = []
            for ext in ('*.json', '*.md', '*.yaml', '*.yml', '*.env', '*.txt', '*.py', '*.sh'):
                files.extend(glob.glob(os.path.join(path, '**', ext), recursive=True))
        else:
            files = [path]

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/security-hardener.py (reported line 227)May include surrounding context.

python
'secrets', 'critical' if 'live' in name.lower() or 'private' in name.lower() else 'high',
                        f'Exposed {name} in ~/{rel_path}',
                        f'Found {len(matches)} match(es) for {name} pattern in file.',
                        fix=f'Move secrets to environment variables or .env file. Remove from {rel_path}.',
                        auto_fixable=False,
                    ))

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

Explicitly scanning home-directory .env files can expose or inventory unrelated credentials that fall outside the user's likely expectation for an OpenClaw-focused audit. In a skill ecosystem, broad credential-access behavior is especially sensitive because the skill may be run with trust and broad filesystem permissions.

Content

Scanner excerpt · scripts/security-hardener.py (reported line 589)May include surrounding context.

python
scan_paths = [p for p in OPENCLAW_CONFIG_PATHS if os.path.exists(p)]
    scan_paths.extend([WORKSPACE_PATH])

    # Also scan home directory .env files
    env_files = glob.glob(os.path.expanduser('~/.env*'))
    scan_paths.extend(env_files)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises and instructs use of shell execution plus file read/write behavior, but it does not declare any explicit tool scope such as permissions or allowed-tools. That creates a mismatch between documented capability and governance, increasing the chance the skill will run with broader access than users or the platform expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation phrases are broad enough to match common requests like 'security audit', 'am I secure', or 'fix my security', which could cause the skill to trigger in situations the user did not intend. Because this skill can modify configuration and permissions, overbroad invocation materially raises the risk of unintended system changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill prominently promotes auto-remediation that changes authentication, bind addresses, plugin state, and file permissions, but it does not present a strong up-front warning about operational impact or possible service disruption. Users may invoke it expecting a report and instead trigger changes that lock out access, break integrations, or alter deployment behavior.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/security-hardener.py (reported line 132)May include surrounding context.

python
findings.append(Finding(
            'auth', 'critical', 'No config file found',
            'OpenClaw configuration file not found. Cannot verify auth settings.',
            fix='Create openclaw.json with proper auth configuration.',
        ))
        return findings

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/security-hardener.py (reported line 253)May include surrounding context.

python
continue
        current_mode = oct(os.stat(fpath).st_mode)[-3:]

        # Check if world-readable
        if int(current_mode[-1]) & 4:  # others can read
            findings.append(Finding(
                'permissions', 'high', f'{label} is world-readable',

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/security-hardener.py (reported line 256)May include surrounding context.

python
continue
        current_mode = oct(os.stat(fpath).st_mode)[-3:]

        # Check if world-readable
        if int(current_mode[-1]) & 4:  # others can read
            findings.append(Finding(
                'permissions', 'high', f'{label} is world-readable',

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/security-hardener.py (reported line 279)May include surrounding context.

python
findings.append(Finding(
                'permissions', 'medium', 'Workspace directory accessible by others',
                f'Workspace has permissions {ws_mode}.',
                fix=f'chmod 700 {ws}',
                auto_fixable=True,
            ))

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/security-hardener.py (reported line 327)May include surrounding context.

python
# Check listening ports
    try:
        result = subprocess.run(
            ['ss', '-tlnp'], capture_output=True, text=True, timeout=10
        )
        if result.returncode == 0:

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/security-hardener.py (reported line 349)May include surrounding context.

python
# Check if UFW/iptables is active
    try:
        result = subprocess.run(
            ['ufw', 'status'], capture_output=True, text=True, timeout=5
        )
        if result.returncode == 0 and 'inactive' in result.stdout.lower():

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/security-hardener.py (reported line 356)May include surrounding context.

python
findings.append(Finding(
                'network', 'medium', 'Firewall (UFW) is inactive',
                'No firewall is running. All ports are potentially accessible.',
                fix='Enable UFW: sudo ufw enable',
            ))
    except (FileNotFoundError, subprocess.TimeoutExpired):
        pass

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill claims CVE-2026-33579 coverage, but the version check neither determines whether the installed version is vulnerable nor runs during the main audit flow. This can create a false sense of security, causing operators to believe they are protected against a named CVE when the tool has not actually verified that status.

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/security-hardener.py (reported line 368)May include surrounding context.

python
"""Check for known CVEs against installed version."""
    findings = []
    try:
        result = subprocess.run(
            ['openclaw', '--version'], capture_output=True, text=True, timeout=10
        )
        if result.returncode == 0:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The permission auto-fix applies chmod changes automatically to files and directories after discovery, without granular confirmation. While intended to harden the system, permission changes can disrupt legitimate workflows, service accounts, or shared environments if applied unexpectedly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The auto-fix path rewrites the OpenClaw config file automatically once fix is invoked, without per-change confirmation or a clear preflight summary of modifications. In security tools, silent config mutation can break service availability, lock out access, or make recovery harder if users did not anticipate exact changes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The keys command expands scanning beyond OpenClaw-specific paths into ~/.env*, increasing access to unrelated personal or project secrets. In a skill context, broad secret discovery is more sensitive because the tool is positioned as OpenClaw hardening, so users may not expect home-directory credential files to be inspected.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

Enumerating ~/.env* files broadens file-system inspection into sensitive user-level credential locations unrelated to the core OpenClaw workspace. In this skill context, that makes the behavior more dangerous because it collects knowledge about unrelated secrets under the guise of an OpenClaw audit.

Content

Scanner excerpt · scripts/security-hardener.py (reported line 590)May include surrounding context.

python
scan_paths.extend([WORKSPACE_PATH])

    # Also scan home directory .env files
    env_files = glob.glob(os.path.expanduser('~/.env*'))
    scan_paths.extend(env_files)

    findings = scan_secrets(scan_paths, verbose=True)

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

A skill described as generating a score and findings may reasonably offer machine-consumable output when a JSON flag is provided. Here, --json appends JSON after the normal formatted console report instead of emitting pure structured output, which does not match the apparent behavior implied by a dedicated JSON output mode.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.