Back to skill

Security audit

ClawGears

Security checks for vulnerabilities and agentic risk

Overview

This OpenClaw security audit skill is mostly purpose-aligned, but it needs review because it performs sensitive local and network checks and has verified bugs that can miss or truncate important security findings.

Install only if you are comfortable with a macOS/OpenClaw security tool reading local configuration, permission, log, and process data. Do not run the IP leak check unless you accept sharing your public IP with external services and saving it locally. Treat generated reports as potentially incomplete until the listener-detection and set -e control-flow bugs are fixed, and approve interactive fixes one by one after reviewing the scripts.

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 (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate-report.sh:65
Finding

Gateway exposure report always misses publicly bound listeners

Content
View full analysis
/dev/null | grep -c "LISTEN" || true) if echo "$gateway_bind" | grep -q "0.0.0.0"; then result="FAIL" details="Gateway is bound to 0.0.0.0 (exposed to network)" fi ``` ### Technical Analysis The `grep -c "LISTEN"` command discards the actual `lsof` listener records and returns only a numeric count. The subsequent test searches that integer for the string `0.0.0.0`, which can never succeed. As a result, the report generator leaves `result` set to `PASS` even when OpenClaw is listening on all network interfaces. The implementation also does not account for wildcard IPv6 listeners such as `[::]`, which can expose the service beyond loopback. ### Attack Path 1. OpenClaw is intentionally or accidentally configured to listen on `0.0.0.0:18789` or another wildcard address. 2. The user runs `generate-report.sh`. 3. `lsof` finds the publicly accessible listener. 4. `grep -c` replaces the listener details with a numeric value such as `1`. 5. The test for `0.0.0.0` fails. 6. The generated report incorrectly records the network-exposure check as passing. 7. The user may leave the exposed service running based on the false assurance. 8. A remote party able to reach the host can attempt to access or attack the exposed OpenClaw gateway. ### Impact Assessment This flaw does not directly grant additional local privileges. Its security impact is a critical false negative: an internet- or LAN-accessible gateway may remain undetected. Depending on gateway authentication and capabilities, exposure could permit unauthorized interaction with the AI assistant, misuse of connected services, access to data available to the gateway, or consumption of associated API resources. ]]>
Remediation
View remediation
/dev/null || true) if [ -z "$gateway_bind" ]; then result="SKIP" details="Gateway is not listening on port 18789" elif echo "$gateway_bind" | grep -Eq '(\*:18789|0\.0\.0\.0:18789|\[::\]:18789)'; then result="FAIL" details="Gateway is listening on a wildcard network address" elif echo "$gateway_bind" | grep -Eq '(127\.0\.0\.1:18789|\[::1\]:18789)'; then result="PASS" details="Gateway is restricted to loopback" else result="WARN" details="Gateway is listening on a non-loopback interface; manual review required" fi ``` Prefer a structured socket-inspection mechanism where available. Add automated tests covering no listener, IPv4 loopback, IPv6 loopback, IPv4 wildcard, IPv6 wildcard, and a specific non-loopback interface. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/quick-check.sh:414
Finding

Quick audit terminates when the first check reports a finding

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ip-leak-check.sh:343
Finding

IP leak audit exits before saving or summarizing detected exposure

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate-report.sh:319
Finding

Report generation can abort on the first status counter increment

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/interactive-fix.sh:357
Finding

Declined or failed remediation action terminates the interactive workflow

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
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example trigger "Run a security audit" is generic and overlaps with common phrasing a user might use in many contexts, without clearly limiting it to this specific skill. The README does not provide scope constraints or exclusion examples to distinguish when this skill should activate versus other audit-related tools.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README states that IP leak detection checks external services such as allegro.earth, Censys, and Shodan, but gives no notice that running the check may disclose the user's IP address and metadata to third parties. In the context of a privacy and security auditing skill, this omission is especially risky because users may assume the audit is entirely local.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README advertises 'Auto-fix capabilities' without warning that remediation actions may modify system configuration, permissions, or security settings. In a security-focused skill, users may trust fixes blindly, increasing the chance of unintended system changes or privilege-affecting actions without informed consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation conditions are broad enough to trigger on generic security-related requests, including multilingual keywords that are not unique to this tool. That can cause the agent to invoke a skill that performs sensitive local inspection and network lookups in situations where the user did not specifically request this OpenClaw-focused audit flow, increasing the chance of unnecessary data access or external IP disclosure.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script is presented as a report generator, but it actively collects host security data including network listeners, TCC permissions, local config contents, log contents, workspace symlinks, and home-directory item counts. In an agent-skill context, undeclared local inspection expands the script's effective privileges and can expose sensitive environmental data to users or downstream systems through generated reports.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This section reads sensitive local sources such as ~/.openclaw/openclaw.json, TCC.db, process/network state, and gateway logs without any user-facing warning or consent flow. Even if intended for auditing, accessing security tokens, permission state, and logs can reveal secrets or privacy-sensitive host metadata that may later be embedded in generated reports.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

The ls-based enumeration of ~/Documents, ~/Pictures, and ~/Desktop inspects local filesystem contents as part of a script marketed primarily as a report generator. In an agent skill, filesystem enumeration is sensitive because it reveals existence and volume of personal data and can be repurposed for profiling or targeting even without exfiltrating file contents.

Content

Scanner excerpt · scripts/generate-report.sh (reported line 187)May include surrounding context.

sh
local details=""

    for dir in Documents Pictures Desktop; do
        local count=$(ls -la ~/$dir/ 2>/dev/null | grep -v "^total" | grep -v "^.localized$" | wc -l)
        if [ "$count" -gt 0 ]; then
            if [ "$result" = "PASS" ]; then
                result="WARN"

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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/interactive-fix.sh (reported line 306)May include surrounding context.

sh
# Start new
    print_info "Starting Gateway..."
    nohup openclaw-gateway > /dev/null 2>&1 &
    sleep 3

    # Verify

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script automatically sends the user's network-identifying data to multiple third-party services (ipify, icanhazip, ifconfig.me, and later the Allegro endpoint) without obtaining explicit consent or providing a privacy warning first. In a security-audit tool, this is dangerous because it expands disclosure of sensitive metadata to external operators and may itself create an exposure trail while the user believes they are only performing a local check.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script prints Censys and Shodan guidance in Chinese, even though the rest of the script is in English, and it does not offer any language selection or explain a required locale. This can violate language or locale policy when users have not opted into that language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This shell script is a code file, so SQP-3 applies to its natural-language strings. Many important status messages, warnings, and remediation steps are presented only in Chinese while other parts are in English, which imposes a locale choice on users without opt-in or documented justification.

Content

No source excerpt is available for this finding.

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/interactive-fix.sh (reported line 333)May include surrounding context.

sh
echo "   • 如果您经常外出使用公共网络,建议开启"
        echo "   • 如果 Mac 固定在安全内网环境,可以保持关闭"
        echo "   • 开启命令:"
        echo "     sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on"
    fi

    echo ""

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/interactive-fix.sh (reported line 336)May include surrounding context.

sh
echo "   • 如果您经常外出使用公共网络,建议开启"
        echo "   • 如果 Mac 固定在安全内网环境,可以保持关闭"
        echo "   • 开启命令:"
        echo "     sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on"
    fi

    echo ""

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/quick-check.sh (reported line 355)May include surrounding context.

sh
echo "   • 如果您经常外出使用公共网络,建议开启"
        echo "   • 如果 Mac 固定在安全内网环境,可以保持关闭"
        echo "   • 开启命令:"
        echo "     sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on"
    fi

    echo ""

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/system-security-check.sh (reported line 86)May include surrounding context.

sh
echo "   • 如果您经常外出使用公共网络,建议开启"
        echo "   • 如果 Mac 固定在安全内网环境,可以保持关闭"
        echo "   • 开启命令:"
        echo "     sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on"
    fi

    echo ""

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/system-security-check.sh (reported line 270)May include surrounding context.

sh
echo "   • 如果您经常外出使用公共网络,建议开启"
        echo "   • 如果 Mac 固定在安全内网环境,可以保持关闭"
        echo "   • 开启命令:"
        echo "     sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on"
    fi

    echo ""

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The grading labels are presented in Chinese ("必须 / 建议 / 可选 / 评估后决定") inside an otherwise English document, and no opt-in or language-selection behavior is described nearby. This can violate language/locale policy expectations because the skill imposes a specific language in part of its instructions without confirming user preference.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script enumerates user home subdirectories (Documents, Pictures, Desktop) to infer iCloud-sync risk without clearly informing the user. Although it only counts items, this still inspects personal filesystem state and may disclose behavioral or privacy-sensitive information in environments where the user expects only report formatting.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The generated HTML sets lang="en", which imposes an English locale in output without any user opt-in or indication that the report is region-specific. The policy requires avoiding forced language or locale choices unless users can choose or the constraint is clearly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script persists the user's public IP and exposure assessment into a local history file without explicit notice or consent. While local storage is less severe than external exfiltration, it creates sensitive forensic residue that may be readable by other local users, included in backups, or later exposed through other tooling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This shell script includes multiple user-facing instructional strings in Chinese, such as the explanatory and recommendation text beginning at L060, while the rest of the interface is partly English. Because the script does not provide any locale selection or user opt-in, it imposes a specific language on users and can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.