Back to skill

Security audit

A Stock Market 1.0.0

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a straightforward A-share quote lookup tool, but its documented install command uses sudo to create a system-wide command linked to a user-writable script.

Install only if you are comfortable with stock symbols being sent to Tencent Finance. Avoid the documented sudo symlink unless you understand the system-wide risk; prefer running the script directly or installing a root-owned copy instead of linking `/usr/local/bin/a-stock` to a user-writable workspace file.

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

T09 · Insecure Skill Coding Practices

Warning
Location
README.md:8
Finding
System-Wide Command Symlink Targets User-Writable Code## Vulnerability Details **File Location**: `README.md`, line 8 **Vulnerability Type**: System-wide executable linked to a user-writable script **Risk Level**: Medium ### Vulnerable Code ```bash sudo ln -sf ~/.openclaw/workspace/skills/a-stock-market/a-stock.py /usr/local/bin/a-stock ``` ### Technical Analysis The documented installation command uses elevated privileges to create `/usr/local/bin/a-stock` as a symbolic link to a script inside the installing user's workspace. That workspace and its script are ordinarily writable by the user without further administrative authorization. Consequently, the content executed through the system-wide command can be changed after installation without modifying `/usr/local/bin/a-stock` or obtaining elevated privileges again. The use of `ln -sf` also forcefully replaces an existing destination with the same name, which can unexpectedly alter an established system command. This creates a trust-boundary weakness when the command is subsequently invoked by another account, an administrator, or privileged automation. The script executes with the invoking process's privileges, not merely the privileges of the account that owns the symlink target. ### Attack Path 1. An administrator follows the installation instructions and runs the documented `sudo ln -sf` command. 2. `/usr/local/bin/a-stock` becomes a system-wide command pointing to the user-writable workspace script. 3. An attacker compromises the owning user account or otherwise obtains write access to `~/.openclaw/workspace/skills/a-stock-market/a-stock.py`. 4. The attacker replaces or modifies the script to contain arbitrary commands. 5. Another user, administrator, or privileged automated process invokes `/usr/local/bin/a-stock`. 6. The modified script executes with the privileges and access rights of that caller. Exploitation therefore depends on both write access to the symlink target and later execution by a more privileged or otherwise valuable caller. ### I ...[truncated 649 chars]
Remediation
## Remediation Suggestions Install an immutable, root-owned copy of the script rather than a symbolic link to a user-writable workspace: ```bash sudo install -o root -g root -m 0755 a-stock.py /usr/local/bin/a-stock ``` Additional hardening measures should include: 1. Avoid `-f` replacement behavior unless overwriting the destination is explicitly intended. 2. Check whether `/usr/local/bin/a-stock` already exists before installation. 3. Verify the source file's integrity and ownership before copying it. 4. Ensure the installed file and its parent directory are not writable by unprivileged users. 5. Use a package manager or controlled deployment process for environments where privileged users or automation will invoke the command. 6. When updates are required, repeat an authenticated administrative installation rather than allowing the executable target to change through a user-writable link.
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 (5)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
## 安装

```bash
# 创建符号链接(需要 sudo 密码)
sudo ln -sf ~/.openclaw/workspace/skills/a-stock-market/a-stock.py /usr/local/bin/a-stock

# 或者直接在技能目录运行
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
## 安装

```bash
# 创建符号链接(需要 sudo 密码)
sudo ln -sf ~/.openclaw/workspace/skills/a-stock-market/a-stock.py /usr/local/bin/a-stock

# 或者直接在技能目录运行
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
SQP-3 applies to natural-language policy issues in any file type. The README forces a specific language presentation throughout the document and does not offer user opt-in, alternatives, or a justification that the skill is intentionally limited to a Chinese-language audience.

Missing User Warnings

Low
Confidence
86% confidence
Finding
This is a markdown file, so SQP-2 applies to omissions in user-facing warnings. The README states that the skill uses a free Tencent Finance API but does not explicitly disclose the privacy implication that requested symbols are transmitted to a third-party service.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
The file’s natural-language description and user-facing help/docstrings are entirely in Chinese, including the usage output, without offering any language choice or stating that the skill is intentionally limited to a Chinese-speaking context. Under the policy rule, forcing a specific language without user opt-in is a locale/language policy concern.

Static analysis

No suspicious patterns detected.