Back to skill

Security audit

Api Rate Limiter

Security checks for vulnerabilities and agentic risk

Overview

This rate-limiter skill appears purpose-aligned, but its installer needs review because it can silently create or replace a system-wide command using sudo.

Review the installer before use. Prefer a per-user install path such as ~/.local/bin, avoid authorizing sudo unless you intentionally want a system-wide command, and check whether /usr/local/bin/api-rate-limiter already exists before installing. Non-Chinese users should also verify the Chinese-only documentation and output are understandable enough to operate safely.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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 (1)

T07 · Tool Hijacking and Spoofing

Warning
Location
install.sh:38
Finding

System-Wide Command Hijacking Through a User-Writable Symbolic Link

Content
View full analysis

Vulnerability Details

File Location: install.sh, lines 38-42
Vulnerability Type: System-wide tool replacement using a symbolic link to user-writable code
Risk Level: Medium

Vulnerable Code

bash
# 创建系统链接
if command -v sudo &> /dev/null; then
    sudo ln -sf "$SKILL_DIR/scripts/api-rate-limiter.sh" /usr/local/bin/api-rate-limiter
else
    ln -sf "$SKILL_DIR/scripts/api-rate-limiter.sh" /usr/local/bin/api-rate-limiter
fi

Technical Analysis

The installer uses ln -sf to create or forcibly replace the system-wide command /usr/local/bin/api-rate-limiter. The symbolic link points to a script under $HOME/.openclaw/workspace/skills, which ordinarily remains writable by the account that installed the skill.

Although creating the link under /usr/local/bin may require elevated privileges, subsequent changes to the linked script do not require another privileged operation. Any process or account able to modify the workspace script can change the behavior of a command that appears to be a trusted system-wide utility.

The force option also replaces an existing /usr/local/bin/api-rate-limiter entry without checking its ownership, type, or origin and without requesting explicit confirmation. This can unexpectedly supersede a legitimate tool with the same name.

Attack Path

  1. A user runs install.sh and authorizes the sudo operation.
  2. The installer creates /usr/local/bin/api-rate-limiter as a symbolic link to the script in the user's OpenClaw workspace.
  3. An attacker compromises the installing account, exploits another process with write access to that workspace, or otherwise modifies scripts/api-rate-limiter.sh.
  4. Another user, administrator, or privileged automation invokes api-rate-limiter through the normal command search path.
  5. The modified script executes with the privileges and environment of that caller.

Exploitation requires write access to the linked ...[truncated 680 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not point a system-wide executable at a user-writable workspace. For system-wide installation, copy the script to a root-owned location such as /usr/local/libexec/api-rate-limiter/ and set restrictive ownership and permissions:

    bash
    sudo install -d -o root -g root -m 0755 /usr/local/libexec/api-rate-limiter
    sudo install -o root -g root -m 0755 \
      "$SKILL_DIR/scripts/api-rate-limiter.sh" \
      /usr/local/libexec/api-rate-limiter/api-rate-limiter
    sudo ln -s \
      /usr/local/libexec/api-rate-limiter/api-rate-limiter \
      /usr/local/bin/api-rate-limiter
    
  2. Prefer a per-user installation under ~/.local/bin when system-wide availability is unnecessary. This avoids elevation and confines trust to the installing user.

  3. Do not use ln -sf blindly. Before installation, check whether the destination already exists, inspect its ownership and type, and refuse to replace it unless the user explicitly approves the replacement.

  4. Make installation scope explicit through options such as --user and --system. Request sudo only after the user deliberately selects system-wide installation.

  5. For a system-wide installation, verify after installation that the executable and every directory in its resolution path are not writable by unprivileged users.

  6. Resolve installation paths relative to the script location rather than relying on the caller's current directory, and avoid the inconsistent hard-coded /root/.openclaw/... paths present in the runtime scripts.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (7)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file presents all operational descriptions and usage guidance in Chinese, and does not indicate that the skill supports other languages or that Chinese is required for a region-specific use case. This can violate a language/locale policy when users are not given an explicit language opt-in or alternative.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The installer makes persistent filesystem changes, sets executable permissions, and creates a symlink under /usr/local/bin, potentially via sudo, without clearly warning the user or asking for confirmation first. This is risky because installation scripts are executable code from an external source, and silent privileged modification increases the chance of accidental system changes or abuse if the package contents are replaced or tampered with.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
90% confidence
Finding

The script invokes sudo to create or replace a symlink in /usr/local/bin, causing a privileged filesystem change. While this is common for installers, it is still security-relevant because it modifies a globally reachable executable path and can overwrite an existing command name without interactive confirmation.

Content

Scanner excerpt · install.sh (reported line 38)May include surrounding context.

sh
chmod +x "$SKILL_DIR/scripts/api-rate-limiter.sh"

# 创建系统链接
if command -v sudo &> /dev/null; then
    sudo ln -sf "$SKILL_DIR/scripts/api-rate-limiter.sh" /usr/local/bin/api-rate-limiter
else
    ln -sf "$SKILL_DIR/scripts/api-rate-limiter.sh" /usr/local/bin/api-rate-limiter

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
84% confidence
Finding

The fallback branch performs the same symlink operation without sudo, which may still succeed when run as root or fail unpredictably depending on permissions. The danger is not code execution by itself, but silent modification of a system command path and forced replacement via ln -sf, which can clobber an existing binary or symlink.

Content

Scanner excerpt · install.sh (reported line 39)May include surrounding context.

sh
# 创建系统链接
if command -v sudo &> /dev/null; then
    sudo ln -sf "$SKILL_DIR/scripts/api-rate-limiter.sh" /usr/local/bin/api-rate-limiter
else
    ln -sf "$SKILL_DIR/scripts/api-rate-limiter.sh" /usr/local/bin/api-rate-limiter
fi

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This shell script uses Chinese for its description, status messages, errors, and help output, with no indication that users can select another language or locale. The policy for this audit flags language-forcing behavior when a skill does not offer user choice or clearly justify the locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

All user-facing comments and output strings in the installer are in Chinese, which imposes a specific language on users without opt-in. The file does not indicate that the skill is intended only for a Chinese-language or region-specific environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script presents its description and usage text only in Chinese via comments and echoed help output. This is a natural-language locale constraint with no opt-in, fallback, or indication that the skill is intended only for Chinese-speaking users or a China-specific environment.

Content

No source excerpt is available for this finding.