Back to skill

Security audit

Free Bash Safety Primer

Security checks for vulnerabilities and agentic risk

Overview

This is a markdown-only security primer; the flagged terms are examples in the article, not runnable behavior.

Reasonable to install as an educational primer. Treat the external marketplace link and strong security claims as promotional, and separately review any linked validator skill before installing or granting it shell access.

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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

YARA rule 'c2_framework_indicators': Command-and-control framework indicators (Cobalt Strike, Metasploit, Sliver, etc.) [malware]

Critical
Category
YARA Match
Confidence
85% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

md
y one of them
leaves a category of attack unblocked.

## The Bottom Line

If your OpenClaw agent has `exec` access — and most useful configurations do —
and it operates on any external input (messages, files, web content, tool
outputs), you have an unvalidated shell execution surface.

This was acceptable when agents were supervised demos. It is not acceptable
when they run autonomously.

ClawHavoc demonstrated that the threat is real and active. The question is
whether you address it before or after something goes wrong on your machine.

---

*The full 23-validator production security chain — validated through production
Claude Code deployments — is available as the
**Bash Security Validator** skill on Claw Mart:*

*https://www.shopclawmart.com/listings/bash-security-validator-production-openclaw-shell-safety-ded33491*

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

md
A filename containing a right-to-left override can display as `readme.txt`
while actually ending in `.exe`. A command containing Unicode homoglyphs for
`/etc/passwd` looks like a benign path until it executes.

**Shell-Specific Escape Vectors**

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
## Why Regex Validation Isn't Enough

The obvious fix is regex pattern matching: block commands that contain `rm -rf`,
`curl | bash`, known exfiltration patterns. Most simple bash validators work
this way.

The problem is that regex operates on text. Shell execution operates on

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

md
**Persistence and Escalation Vectors**

These are the attacks that matter most for autonomous agents: commands that
modify cron, init, or systemd entries; commands that install backdoors into
shell profiles; commands that create persistent network listeners; commands
that modify sudo configuration. An agent that runs one of these once, even
accidentally, has a problem that survives reboots.

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

md
These are the attacks that matter most for autonomous agents: commands that
modify cron, init, or systemd entries; commands that install backdoors into
shell profiles; commands that create persistent network listeners; commands
that modify sudo configuration. An agent that runs one of these once, even
accidentally, has a problem that survives reboots.

## Why ClawHavoc Happened