Back to skill

Security audit

linux-system-health

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed Linux diagnostics tool, but its root-run script has unsafe privileged execution paths that users should review before installing or running.

Review this skill before installing, and do not run the full diagnostics script as root on multi-user or sensitive hosts until the Chromium discovery/launch logic and DNS bash-c construction are fixed. Prefer running only the relevant read-only sections with least privilege, and avoid executing browser binaries from user home caches as root.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/diagnostics.sh:326
Finding

Root Execution of a User-Controlled Chromium Binary

Content
View full analysis
/dev/null); do [ -x "$candidate" ] && CHROME_BIN="$candidate" && break done if [ -z "$CHROME_BIN" ]; then CHROME_BIN=$(find /root/.cache/ms-playwright /home/*/.cache/ms-playwright -name chrome -type f 2>/dev/null | head -1) fi echo "Chrome binary: ${CHROME_BIN:-not found}" # Step 2: If Chrome binary found, test if it launches in headless mode if [ -n "$CHROME_BIN" ]; then CHROME_TEST=$(timeout 5 "$CHROME_BIN" --headless=new --no-sandbox --disable-gpu --dump-dom about:blank 2>&1) ``` ### Technical Analysis The Skill instructs users to run the diagnostic script as root. If no system-installed Chromium binary is found, the script recursively searches `/home/*/.cache/ms-playwright` and selects the first regular file named `chrome`. Home-directory cache locations are normally writable by their corresponding unprivileged users. The script does not verify: - The owner of the discovered binary. - Whether the binary or its parent directories are writable by an unprivileged account. - Whether the canonical path belongs to an approved Playwright installation. - The binary's integrity, package origin, or expected hash. - Whether the fallback file is executable before attempting to run it. - Whether execution should occur as the owner of the cache rather than as root. The selected file is subsequently executed with the root privileges of the diagnostic script. The `--no-sandbox` argument does not protect against this issue because a malicious executable can ignore all Chromium arguments. ### Attack Path 1. An unprivileged local user creates a directory under their Playwright cache: ```bash mkdir -p ~/.cache/ms-playw ...[truncated 1431 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/diagnostics.sh:178
Finding

Shell Command Injection Through Nameserver Configuration

Content
View full analysis
/dev/tcp/$ns/53" 2>/dev/null && echo "$ns reachable" || echo "$ns UNREACHABLE" done ``` ### Technical Analysis The script reads the second whitespace-delimited field of each `nameserver` entry in `/etc/resolv.conf`, interpolates it into a command string, and passes that string to `bash -c`. Shell quoting around the outer string does not make the interpolated value safe. After interpolation, the new `bash` process reparses shell metacharacters contained in `ns`. Characters such as semicolons, command substitutions, redirections, and comment markers can therefore alter the intended command. Because the Skill directs users to run the script as root, injected commands would execute with root privileges. Exploitation requires an attacker to influence `/etc/resolv.conf` or a resolver-configuration pipeline. This may occur through a compromised provisioning process, an unsafe configuration-management workflow, or another component that accepts insufficiently validated resolver data. ### Attack Path 1. An attacker gains the ability to influence a `nameserver` token in `/etc/resolv.conf` or the process that generates it. 2. The attacker introduces shell syntax into the token. Conceptually, a value can terminate the `/dev/tcp` redirection, execute another command, and comment out the remaining `/53` suffix. 3. An administrator or AI agent runs the diagnostics as root. 4. The loop reads the malicious token into `ns`. 5. Variable interpolation constructs a new shell program containing attacker-controlled syntax. 6. `bash -c` reparses and executes the injected command as root. ### Impact Assessment If the prerequisite configuration influence is av ...[truncated 553 chars]
Remediation
View remediation
"/dev/tcp/$1/53"' -- "$ns" ``` 5. Avoid `for ns in $(...)`, which performs word splitting and pathname expansion. Use a line-oriented `while read` loop. 6. Run the network reachability test without root privileges. TCP connection attempts to port 53 do not normally require privileged execution. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (17)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Using rm -f on a predictable root-owned path in /tmp is dangerous because /tmp is world-writable and attacker-controlled. If the script is run as root, a local attacker may be able to pre-place or race filesystem objects at /tmp/.oc_write_test, turning this cleanup step into a symlink/hardlink or TOCTOU issue and causing deletion or modification of unintended files depending on platform protections.

Content

Scanner excerpt · scripts/diagnostics.sh (reported line 258)May include surrounding context.

sh
df -ih | awk 'NR>1 && $5 ~ /%/ {gsub(/%/,"",$5); if ($5+0 >= 80) print}'

# Write test (self-cleaning)
touch /tmp/.oc_write_test 2>/dev/null && rm -f /tmp/.oc_write_test && echo "Write OK" || echo "Write FAILED"

###############################################
# Section 13: Firewall & Outbound Connectivity

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/diagnostics.sh (reported line 258)May include surrounding context.

sh
df -ih | awk 'NR>1 && $5 ~ /%/ {gsub(/%/,"",$5); if ($5+0 >= 80) print}'

# Write test (self-cleaning)
touch /tmp/.oc_write_test 2>/dev/null && rm -f /tmp/.oc_write_test && echo "Write OK" || echo "Write FAILED"

###############################################
# Section 13: Firewall & Outbound Connectivity

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 · README.md (reported line 32)May include surrounding context.

md
## Prerequisites

- Linux server (Ubuntu, Debian, CentOS, RHEL, Amazon Linux, etc.)
- Root or sudo access
- Standard coreutils and system tools: `free`, `df`, `ps`, `ss`, `sysctl`, `iptables`, `dmesg`, `journalctl`, `timedatectl`, `ldconfig`, `ldd`, `locale`, `mount`, `nft`, `ufw`

## Usage

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 · README.md (reported line 48)May include surrounding context.

Copy the SKILL.md file into your AI agent's skill directory. For OpenClaw:

bash
mkdir -p ~/.openclaw/skills/linux-system-health
cp SKILL.md ~/.openclaw/skills/linux-system-health/

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

md
| Framework | Method |
|-----------|--------|
| OpenClaw | `clawhub install linux-system-health` |
| Qoder | Copy to `.qoder/skills/linux-system-health/SKILL.md` |
| Claude Code | See below |
| Cursor | Reference in `.cursorrules` |
| Codex | Reference in `AGENTS.md` |

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

claude install-skill https://raw.githubusercontent.com/ecsgo-helper/openclaw-system-health/main/linux-system-health/SKILL.md

text

This installs the skill to `.claude/skills/` and makes it available as a slash command in Claude Code sessions.

**Method 2: Manual install**

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

Method 2: Manual install

bash
mkdir -p .claude/skills
cp SKILL.md .claude/skills/linux-system-health.md

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
91% confidence
Finding

The skill instructs the runner to execute the diagnostics script as root, which materially increases the blast radius if the referenced script is modified, compromised, or contains unsafe command behavior. Although the markdown itself is descriptive, it explicitly drives privileged execution of external code and the skill also includes network probes and a write test, making misuse or accidental harm more consequential.

Content

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

md
2. Then run the sections relevant to the user's reported symptoms
3. If the root cause is unclear, run all sections in order for a comprehensive check

> **Commands**: Run the corresponding section in [scripts/diagnostics.sh](scripts/diagnostics.sh). Run as root with `export LANG=C`.
>
> **Issue Registry**: See [reference.md](reference.md) for severity level definitions and the complete issue name table.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The markdown explicitly instructs operators to run the diagnostic as root with export LANG=C. This imposes a specific locale choice on execution without offering user choice or documenting why this locale override is required as an organizational policy exception.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% 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 · SKILL.md (reported line 220)May include surrounding context.

md
**Judgment rules**:
- None of `chronyd`, `ntpd`, or `systemd-timesyncd` is active → **OpenClaw.Time.NTPServiceNotRunning** (ERROR)
  - Remediation: Install and enable a time sync service — `yum install chrony && systemctl enable --now chronyd` (RHEL/CentOS) or `apt install chrony && systemctl enable --now chronyd` (Debian/Ubuntu)
- `timedatectl` shows "NTP synchronized: no" → **OpenClaw.Time.ClockNotSynchronized** (CRITICAL)
  - Remediation: Start NTP service; verify NTP server reachability (`chronyc sources` or `ntpq -p`); check firewall allows UDP port 123
- `chronyc tracking` shows system clock offset > 3 seconds, or hwclock drift > 5 seconds from system time → **OpenClaw.Time.ClockDriftDetected** (WARNING)

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · README.md (reported line 100)May include surrounding context.

md
| 20 | OpenClaw.Kernel.TcpMaxTwBucketsTooLow | WARNING |
| 21 | OpenClaw.Kernel.TcpTwReuseNotEnabled | WARNING |
| 22 | OpenClaw.Kernel.TimeWaitOverflow | WARNING |
| 23 | OpenClaw.Kernel.TcpListenOverflows | WARNING |
| 24 | OpenClaw.Kernel.StrictOvercommitWithLowSwap | WARNING |
| 25 | OpenClaw.Network.NoDNSNameservers | ERROR |
| 26 | OpenClaw.Network.DNSResolutionFailed | CRITICAL |

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · SKILL.md (reported line 193)May include surrounding context.

md
| 20 | OpenClaw.Kernel.TcpMaxTwBucketsTooLow | WARNING |
| 21 | OpenClaw.Kernel.TcpTwReuseNotEnabled | WARNING |
| 22 | OpenClaw.Kernel.TimeWaitOverflow | WARNING |
| 23 | OpenClaw.Kernel.TcpListenOverflows | WARNING |
| 24 | OpenClaw.Kernel.StrictOvercommitWithLowSwap | WARNING |
| 25 | OpenClaw.Network.NoDNSNameservers | ERROR |
| 26 | OpenClaw.Network.DNSResolutionFailed | CRITICAL |

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · reference.md (reported line 41)May include surrounding context.

md
| 20 | OpenClaw.Kernel.TcpMaxTwBucketsTooLow | WARNING |
| 21 | OpenClaw.Kernel.TcpTwReuseNotEnabled | WARNING |
| 22 | OpenClaw.Kernel.TimeWaitOverflow | WARNING |
| 23 | OpenClaw.Kernel.TcpListenOverflows | WARNING |
| 24 | OpenClaw.Kernel.StrictOvercommitWithLowSwap | WARNING |
| 25 | OpenClaw.Network.NoDNSNameservers | ERROR |
| 26 | OpenClaw.Network.DNSResolutionFailed | CRITICAL |

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/diagnostics.sh (reported line 3)May include surrounding context.

sh
#!/usr/bin/env bash
# linux-system-health diagnostic commands
# Run as root with: export LANG=C
# Each section is independent — run sections relevant to the reported symptoms.
#
# DATA ACCESS SCOPE — this script reads the following system areas:

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/diagnostics.sh (reported line 20)May include surrounding context.

sh
#   Network probes    : DNS resolution tests (nslookup/dig/getent to github.com),
#                       nameserver TCP/53 reachability, Chrome headless launch test
#
# WRITE OPERATIONS:
#   Section 12 only — creates and immediately removes /tmp/.oc_write_test
#   to verify filesystem writability. No other writes are performed.

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/diagnostics.sh (reported line 257)May include surrounding context.

sh
# Inode usage — high inode consumption on any filesystem
df -ih | awk 'NR>1 && $5 ~ /%/ {gsub(/%/,"",$5); if ($5+0 >= 80) print}'

# Write test (self-cleaning)
touch /tmp/.oc_write_test 2>/dev/null && rm -f /tmp/.oc_write_test && echo "Write OK" || echo "Write FAILED"

###############################################

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The natural-language issue names on these lines describe locale configuration requirements, including detecting a non-UTF-8 locale. In a reference document, this can imply a preferred locale policy, but the file does not explain whether this is optional, user-selected, or required for a specific regional/compliance reason.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.