Back to skill

Security audit

AI Business Hierarchies - Autonomous Agent Companies

Security checks for vulnerabilities and agentic risk

Overview

This skill is not clearly malicious, but it needs Review because it sets up persistent business-agent automation with unsafe cron setup and weak safeguards.

Review carefully before installing. Use only with a low-privilege account, validate business names to simple letters/numbers/hyphens, inspect the generated cron entries before installing them, and assume daily reports may store sensitive agent conversation history. Do not let the spawned agents send outreach, change finances, handle HR/payroll, or modify live business systems without explicit human approval and audit logs.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/setup-daily-reporting.sh:18
Finding
Persistent Cron Command Injection Through an Unvalidated Business Name<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup-daily-reporting.sh:18-24, 92-110` **Vulnerability Type**: Persistent command injection through generated crontab content **Risk Level**: High ### Vulnerable Code ```bash # Prompt for business name if [ -z "$1" ]; then read -p "Business name (e.g., my-company): " BUSINESS_NAME else BUSINESS_NAME="$1" fi BUSINESS_DIR="$HOME/business/$BUSINESS_NAME" ``` The unvalidated value is subsequently embedded into paths written directly to a cron configuration: ```bash # Setup cron jobs CRON_FILE="$HOME/.business-cron-$BUSINESS_NAME" cat > "$CRON_FILE" << EOF # AI Business Hierarchies - Automated Reporting for $BUSINESS_NAME # Daily Supervisor Reports (8 AM UTC) 0 8 * * * $REPORT_SCRIPT # Weekly CEO Report (Monday 9 AM UTC) 0 9 * * 1 $BUSINESS_DIR/scripts/generate-weekly-report.sh # Monthly Strategy Review (1st of month, 10 AM UTC) 0 10 1 * * $BUSINESS_DIR/scripts/generate-monthly-report.sh EOF echo -e "${YELLOW}Installing cron jobs...${NC}" crontab -l > /tmp/current-cron 2>/dev/null || touch /tmp/current-cron cat "$CRON_FILE" >> /tmp/current-cron crontab /tmp/current-cron ``` ### Technical Analysis `BUSINESS_NAME` is accepted from either a command-line argument or interactive input without enforcing an identifier format. It is used to construct `BUSINESS_DIR`, `REPORT_SCRIPT`, and `CRON_FILE`. The resulting paths are inserted into executable cron lines without shell quoting or escaping. Cron executes the command portion of each entry through a shell. Consequently, shell metacharacters in a business name—such as semicolons, command substitutions, comment markers, or line breaks—can alter the command interpreted by cron. The directory existence check does not sanitize the value; an attacker can create a correspondingly named directory or target an existing specially named directory. Because the generated text is installed with `crontab`, successful injection persists beyond the setup ...[truncated 2024 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Enforce a strict allowlist before constructing any path: ```bash if [[ ! "$BUSINESS_NAME" =~ ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$ ]]; then printf 'Error: business name may contain only letters, digits, underscores, and hyphens.\n' >&2 exit 1 fi ``` 2. Explicitly reject control characters, whitespace, slashes, shell metacharacters, and leading hyphens. 3. Do not place variable paths directly into cron command fields. Generate a fixed wrapper command and pass data through a validated configuration file, or apply robust shell quoting before writing an entry. 4. Use managed start/end markers for this Skill’s entries rather than appending unrestricted content: ```text # BEGIN ai-business-hierarchies: validated-name ... # END ai-business-hierarchies: validated-name ``` 5. Show the exact proposed entries and require explicit user confirmation before changing the crontab. 6. Apply the same business-name validation in `scripts/setup-business.sh` so malformed or ambiguous directory names cannot be created through the normal workflow. 7. Add automated tests covering semicolons, command substitutions, spaces, tabs, line breaks, percent signs, comment markers, slashes, and leading hyphens. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup-daily-reporting.sh:108
Finding
Predictable Shared Temporary File Allows Symlink and Race Attacks<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup-daily-reporting.sh:108-111` **Vulnerability Type**: Insecure temporary-file handling and time-of-check/time-of-use race **Risk Level**: Medium ### Vulnerable Code ```bash crontab -l > /tmp/current-cron 2>/dev/null || touch /tmp/current-cron cat "$CRON_FILE" >> /tmp/current-cron crontab /tmp/current-cron rm /tmp/current-cron ``` ### Technical Analysis The script uses the fixed path `/tmp/current-cron` in a generally world-writable directory. It does not create the file exclusively, verify its owner or type, prevent symbolic-link traversal, or lock it against concurrent modification. Shell redirection opens the target before `crontab -l` runs. If another local process pre-creates `/tmp/current-cron` as a symbolic link, the redirection can truncate the linked file when the victim has permission to write to it. Even if the initial write is safe, another process can replace or modify the temporary file between the write, append, and `crontab` operations. Concurrent invocations of the setup script use the same path and can overwrite each other’s content, install incomplete or mixed crontabs, or remove the file while another process is still using it. ### Attack Path 1. A local attacker predicts that the script will use `/tmp/current-cron`. 2. Before the victim invokes the script, the attacker creates that path as a symbolic link to a file writable by the victim, or repeatedly swaps the path during execution. 3. The `crontab -l > /tmp/current-cron` redirection follows the attacker-controlled link and truncates or overwrites the target. 4. Alternatively, the attacker modifies or replaces `/tmp/current-cron` after the existing crontab is exported but before `crontab /tmp/current-cron` is called. 5. The script installs the attacker-modified content as the victim’s crontab. 6. Injected cron commands then execute with the victim account’s privileges. The attack requires local filesystem access a ...[truncated 802 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Replace the fixed temporary path with a securely and exclusively created file: ```bash tmp_cron="$(mktemp "${TMPDIR:-/tmp}/business-cron.XXXXXX")" trap 'rm -f -- "$tmp_cron"' EXIT HUP INT TERM chmod 600 "$tmp_cron" crontab -l > "$tmp_cron" 2>/dev/null || true cat -- "$CRON_FILE" >> "$tmp_cron" crontab "$tmp_cron" ``` Additional hardening should include: 1. Verify that `mktemp` succeeds before continuing. 2. Retain restrictive permissions such as mode `0600`. 3. Use a cleanup trap so interruption does not leave sensitive cron content behind. 4. Avoid reopening the temporary pathname where practical; use file descriptors to reduce replacement opportunities. 5. Serialize concurrent modifications with an appropriate lock, such as `flock`, if multiple setup processes may run at once. 6. Preserve and validate the existing crontab before installation. 7. Install only entries within uniquely named managed marker blocks, preventing duplicate entries on repeated runs. 8. Check the exit status of `crontab` and retain a secure backup if installation fails. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The skill markets itself as providing autonomous operation, daily tracking, auto-optimization, and self-healing, but the content only documents structure and references external scripts. This mismatch is dangerous because operators may overtrust the automation, assume monitoring and safeguards exist when they do not, and deploy autonomous business workflows without the promised controls or review points.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The skill markets itself as providing autonomous operation, daily tracking, auto-optimization, and self-healing, but the content only documents structure and references external scripts. This mismatch is dangerous because operators may overtrust the automation, assume monitoring and safeguards exist when they do not, and deploy autonomous business workflows without the promised controls or review points.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
crontab -l > /tmp/current-cron 2>/dev/null || touch /tmp/current-cron
cat "$CRON_FILE" >> /tmp/current-cron
crontab /tmp/current-cron
rm /tmp/current-cron

echo -e "${GREEN}✓ Cron jobs installed${NC}\n"
Confidence
95% confidence
Finding
Using a fixed path in /tmp for temporary cron content is unsafe because /tmp is world-writable and vulnerable to symlink or race-condition attacks. An attacker on the same system could potentially replace /tmp/current-cron with a symlink and cause unintended file overwrite/deletion or interfere with the cron installation workflow.

Session Persistence

Medium
Category
Rogue Agent
Content
clawhub install miknas-ai-business-hierarchies
```

### 2. Create Your AI Business

```bash
cd ~/.openclaw/workspace/skills/ai-business-hierarchies
Confidence
91% confidence
Finding
The README promotes spawning threaded session-based agents and configuring daily reporting, which implies persistent autonomous processes that may continue acting without active user supervision. In the context of a business-automation skill marketed as self-optimizing and self-healing, persistence meaningfully increases risk of unintended actions, runaway automation, and lingering access to business data or system resources.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The README instructs users to execute setup scripts and enable cron-based automation without disclosing that these actions may modify the local environment, create persistent jobs, or spawn long-running agents. In a skill explicitly designed for autonomous, 24/7 operation, lack of warnings materially increases the chance that users will install persistent automation they do not fully understand or monitor.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill embeds multiple shell commands and agent-spawning instructions but does not declare any tool scope or allowed-tools boundary. In an agent ecosystem, this increases the chance that a host or user assumes the skill is documentation-only while it actually encourages privileged shell execution and process creation, which can lead to unintended automation or unsafe command execution.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill encourages autonomous outreach campaigns, cold calls, follow-ups, cron-based reporting, and automated workflow updates without prominent warnings, consent controls, or change-management safeguards. In context, this is more dangerous because the skill is specifically designed to operate continuously and at scale, so misconfigured agents could send external communications, spam contacts, alter system state, or create compliance and reputational damage quickly.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The document simultaneously promotes businesses that scale without human intervention and later says critical decisions should never be fully automated. This contradictory guidance can cause unsafe deployment decisions, because users may rely on the stronger autonomy claims and omit oversight for decisions involving finances, hiring, outreach, or compliance.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The generated report script collects agent session labels, recent messages, and session history and writes them to persistent markdown files without any consent, warning, or filtering. In this skill’s context of autonomous business agents, that history can easily contain sensitive prompts, credentials, business data, or personal information, making silent retention and disclosure a real privacy/security risk.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The script modifies the user’s crontab automatically, creating persistent scheduled execution without an explicit confirmation step. Even if intended for convenience, silent installation of persistence is risky because it changes system behavior and can continue collecting data or running scripts long after the user expected.

Session Persistence

Medium
Category
Rogue Agent
Content
EOF

echo -e "${YELLOW}Installing cron jobs...${NC}"
crontab -l > /tmp/current-cron 2>/dev/null || touch /tmp/current-cron
cat "$CRON_FILE" >> /tmp/current-cron
crontab /tmp/current-cron
rm /tmp/current-cron
Confidence
92% confidence
Finding
This line reads the existing crontab as part of installing recurring jobs, contributing to persistence by preserving and extending scheduled execution. In a skill designed to run autonomous agents 24/7, persistence is central to operation, which makes unprompted cron-based scheduling more dangerous than a one-shot setup action.

Session Persistence

Medium
Category
Rogue Agent
Content
# List scheduled jobs
echo -e "${BLUE}=== Scheduled Cron Jobs ===${NC}\n"
crontab -l | grep "$BUSINESS_NAME" | grep -v "^#" | sed 's/^/  /' || echo "No cron jobs found"

echo ""
echo -e "${YELLOW}=== Reporting Schedule ===${NC}\n"
Confidence
85% 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.

Session Persistence

Medium
Category
Rogue Agent
Content
# List scheduled jobs
echo -e "${BLUE}=== Scheduled Cron Jobs ===${NC}\n"
crontab -l | grep "$BUSINESS_NAME" | grep -v "^#" | sed 's/^/  /' || echo "No cron jobs found"

echo ""
echo -e "${YELLOW}=== Reporting Schedule ===${NC}\n"
Confidence
85% 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.

Session Persistence

Medium
Category
Rogue Agent
Content
echo "Reports will be saved to: $BUSINESS_DIR/reports/"
echo ""
echo "To view current crontab: crontab -l"
echo "To remove jobs: crontab -e (delete lines for $BUSINESS_NAME)"
Confidence
85% 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.

Intent-Code Divergence

Low
Confidence
93% confidence
Finding
The documentation markets the skill as enabling businesses to run with complete automation and without human intervention. Later in the same README, it explicitly recommends 'Human Oversight' and says to 'Never fully automate critical decisions,' which directly conflicts with the earlier claim about full autonomy.

Intent-Code Divergence

Low
Confidence
88% confidence
Finding
The 'What This Does' section says the system replaces traditional human management, suggesting removal of human managerial involvement. However, the hierarchy diagram and best practices explicitly keep a 'Human Owner' at the top and require ongoing human oversight, contradicting the replacement claim.

Missing User Warnings

Low
Confidence
88% confidence
Finding
This shell script creates directories and writes a strategy file containing user-provided business information, which can affect user data on the local filesystem. Although it prints status messages about creating the business structure, it does not explicitly warn that the heredoc write will create or overwrite the target file with the entered content.

Static analysis

No suspicious patterns detected.