Back to skill

Security audit

rice-tracker

Security checks for vulnerabilities and agentic risk

Overview

This rice tracker mostly matches its stated purpose, but it exposes customer and payment records through an unauthenticated network service and uses risky background/stop scripts.

Install only if you are comfortable running a local web app that stores customer and payment records on disk. Before use, bind it to 127.0.0.1, add authentication and CSRF protection, avoid exposing it to your LAN, remove sample/backup customer-like data, and review the start/stop scripts before running them.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/app.py:16
Finding

Unauthenticated Network Exposure of Customer and Financial Records

Content
View full analysis
0, "alerts": alerts, "has_settle_alerts": len(settle_alerts) > 0, "settle_alerts": settle_alerts, "checked_at": date.today().isoformat(), }) ``` ```python if __name__ == "__main__": app.run(host=HOST, port=PORT, debug=False) ``` The same public binding is used by the alternate wrapper: ```p ...[truncated 2143 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/app.py:505
Finding

Missing CSRF Protection on State-Changing Endpoints

Content
View full analysis
/", methods=["POST"]) def mark_paid(customer_idx, purchase_idx): records = load_records() if 0 <= customer_idx < len(records): r = records[customer_idx] if "purchases" in r and 0 <= purchase_idx < len(r["purchases"]): r["purchases"][purchase_idx]["paid"] = True save_records(records) return redirect(url_for("index") + "?tab=" + ( request.args.get("tab", "reconcile") )) @app.route("/api/delete-customer/", methods=["POST"]) def delete_customer(idx): records = load_records() if 0 <= idx < len(records): del records[idx] save_records(records) return redirect(url_for("index")) ``` The corresponding HTML forms contain no anti-CSRF token: ```html 删除 ``` ### Technical Analysis The application accepts ordinary form-encoded POST requests for destructive and financially significant operations. These requests contain no unpredictable C ...[truncated 1580 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/start.sh:11
Finding

Lifecycle Scripts Force-Kill Unrelated Processes Using Port 5001

Content
View full analysis
/dev/null 2>&1 if [ $? -eq 0 ]; then echo "Port $PORT is occupied; stopping the old process..." lsof -ti :$PORT | xargs kill -9 2>/dev/null sleep 1 fi } ``` From `scripts/stop.sh`: ```bash else # Attempt to kill the process through the port lsof -ti :5001 | xargs kill -9 2>/dev/null echo "Service stopped" fi ``` ### Technical Analysis The scripts assume that every process listening on port 5001 belongs to this Skill. They obtain all matching process identifiers through `lsof` and send `SIGKILL` without verifying the process owner, executable path, command line, start time, or relationship to the current application. `SIGKILL` prevents the target from running cleanup handlers, flushing buffered data, or completing in-progress transactions. The startup script therefore treats an ordinary port collision as authorization to terminate another service. ### Attack Path 1. A legitimate, unrelated application listens on port 5001. 2. A user runs `scripts/start.sh`, or runs `scripts/stop.sh` while no `app.pid` file exists. 3. The script obtains the unrelated application's PID using `lsof`. 4. The script sends `SIGKILL` to that process. 5. The unrelated service immediately terminates and may lose buffered or in-progress data. A malicious local user who can influence which same-user process occupies the port can also use this behavior to induce predictable service disruption when the Skill's lifecycle script is run. ### Impact Assessment The scripts can terminate any process that the invoking user has permission to signal and that happens to listen on port 5001. The affected scope is not restricted ...[truncated 187 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/stop.sh:5
Finding

Untrusted or Stale PID File Can Terminate an Unrelated Process

Content
View full analysis
/dev/null; then kill $PID echo "Service stopped (PID: $PID)" else echo "Process does not exist (PID: $PID)" fi rm -f app.pid fi ``` ### Technical Analysis The shutdown script trusts the contents of `app.pid` as proof that the referenced process belongs to this application. It does not validate that the value is numeric and does not verify the target process's executable, command line, owner, or start time. PID values are reused by operating systems. Therefore, even an originally valid but stale PID file may eventually refer to an unrelated process. If the file is writable by another actor, that actor may also replace its contents with the PID of another process. ### Attack Path 1. The `app.pid` file remains after the original Flask or Gunicorn process exits, or its contents are replaced. 2. The operating system reuses the recorded PID for another process owned by the same user. 3. The user runs `scripts/stop.sh`. 4. `kill -0` succeeds because a process with that PID exists. 5. The script sends `SIGTERM` to the unrelated process. ### Impact Assessment The script can terminate an unrelated process running with the same user's privileges. It does not provide privilege escalation beyond the invoking user's existing signal permissions, but it can cause service interruption and potentially interrupt in-progress work. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
backup/records_v1.json:2
Finding

Customer-Like Personal and Household Data Included in Distributed Backup

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (23)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description presents a full-featured rice procurement management system with customer-level inventory, debt, transfer, and reconciliation functions. The supplied code chunk does not implement those business capabilities; instead, it serves as a thin startup wrapper that imports an existing app and runs it on host 0.0.0.0, port 8080. While this may support the broader application, the actual behavior visible here is launching a network-accessible web service, which is not part of the declared description. Because the provided code chunk's observable purpose is materially narrower and somewhat different from the declared functionality, this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a business application for rice procurement, inventory, debt, and reconciliation management. The supplied code does not implement any of those domain features. Instead, it is an operational stop script whose purpose is to terminate a local service process, either via a stored PID or by killing whatever is listening on port 5001. This is a materially different primary purpose from the declared functionality, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The combination of PORT=5001 and HOST=0.0.0.0 exposes the web UI to the local network, while the app handles customer debt, contact, and reconciliation data. In this business context, silent exposure is more dangerous because users may reasonably assume a small household/procurement tracker is local-only and may enter sensitive personal or financial information.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill instructs use of shell commands, background execution, and file paths but does not declare any tool scope or permissions. This creates an overbroad trust boundary: an agent may need shell/file capabilities to operate the skill without users being clearly informed or the platform constraining what the skill can access.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The invocation examples are broad natural-language triggers like '删除张三的记录' and '运行一次大米检查' without constraints, confirmation rules, or clear activation boundaries. In an agent setting, ambiguous triggers can cause unintended execution of destructive actions or shell-backed operations when the user did not intend to invoke this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill advertises deletion of customer records but provides no warning, confirmation step, or recovery guidance. This is dangerous because an agent may carry out irreversible data loss from a brief natural-language instruction, especially in a bookkeeping context involving debt and reconciliation records.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Using 'nohup ... &' to launch a persistent background web service introduces session persistence outside normal agent task scope and can leave long-running processes active after the interaction ends. This increases risk of unintended resource consumption, stale services, exposed local endpoints, and reduced visibility into what remains running on the host.

Content

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

bash
# 启动 Web 服务(后台运行)
nohup python3 ~/.openclaw/workspace/skills/rice-tracker/scripts/app.py \
  > ~/.openclaw/workspace/skills/rice-tracker/app.log 2>&1 &

# 测试提醒脚本

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The app binds Flask to 0.0.0.0, making the rice/customer tracking service reachable from the local network rather than only the host machine. Because the service has no authentication and exposes customer names, phone numbers, payment status, and inventory data, any reachable peer could access or manipulate records if network access exists.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code stores customer names, phone numbers, purchase history, payment status, and notes in a file under the user's home directory. While the app prints the file path at startup, there is no in-app disclosure, comment, or prompt near the data-collection and write paths warning users that personal/business data will be persisted locally.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The /api/records endpoint returns all stored customer records as raw JSON, including personal and financial tracking fields, without any access control. In combination with the all-interfaces bind, this creates a simple data-exfiltration path for anyone who can reach the service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code presents its title and runtime messages entirely in Chinese, and there is no indication that users can select another language or opt in to this locale. The policy for natural-language content applies to all file types, including code string literals, so hard-coding a single language can violate locale-choice requirements.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The app binds Flask to 0.0.0.0, making a personal bookkeeping tool reachable from other machines on the network. Because the application appears to expose customer names, phone numbers, debt status, bank-account-related fields, and order history without any authentication shown in this file, unintended network exposure can lead to unauthorized viewing or tampering of sensitive business data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code persists business records to ~/.openclaw/workspace/rice-shop-records.json, which affects user data on disk. Although the file header explains how to run the app, there is no visible warning to users that submitted customer information will be stored locally, nor any user-facing log/print/confirmation around this write behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The HTML declares lang="zh-CN" and the interface text is fully Chinese, which forces a specific language/locale experience. Under the stated policy, this is a natural-language locale constraint without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module description and all user-facing messages are written exclusively in Chinese, indicating the skill is intended to operate in a fixed language. Under the policy, forcing a specific language without user opt-in or a documented region-specific justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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/start.sh (reported line 33)May include surrounding context.

sh
echo "   本机访问: http://localhost:$PORT"
    echo "   手机访问: http://$(get_ip):$PORT"
    echo ""
    nohup python3 app.py > app.log 2>&1 &
    echo $! > app.pid
else
    echo "🚀 启动模式: Gunicorn 生产服务器"

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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/start.sh (reported line 40)May include surrounding context.

sh
echo "   本机访问: http://localhost:$PORT"
    echo "   手机访问: http://$(get_ip):$PORT"
    echo ""
    nohup python3 app.py > app.log 2>&1 &
    echo $! > app.pid
else
    echo "🚀 启动模式: Gunicorn 生产服务器"

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This JSON record set uses Chinese-language values in owner and note fields throughout the file, which indicates the skill data is effectively constrained to a single language/locale. Under the stated policy, forcing or assuming a specific language without user opt-in or documented justification can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The application title, UI labels, alerts, and HTML locale are fixed to Chinese, which forces a specific language experience on all users. The policy allows locale constraints only when user choice or clear justified documentation is provided, neither of which appears in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

Setting the page language to zh-CN is itself not inherently unsafe, but here it reinforces a mandatory Chinese-only interface with no opt-in or alternate locale path. This matches the language/locale policy concern for forced language choice.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The /api/alert endpoint publishes customer-specific inventory depletion and unpaid-balance reminders as machine-readable data. Although narrower than the full records API, it still leaks sensitive operational and payment information to any unauthenticated caller.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest frames the skill as a rice purchase and reconciliation tracker, while the code documentation and implementation present it as a Flask web app served via browser access. A browser UI is a reasonable implementation detail, but exposing it as a served web application broadens the operational model beyond the narrow tracking description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script's comments and all user-visible status messages are written in Chinese, which imposes a specific language on users without any opt-in or alternative locale support. Under the policy, language constraints should either be optional for users or clearly justified as region-specific.

Content

No source excerpt is available for this finding.