Back to skill

Security audit

Openclaw Cnc Core

Security checks for vulnerabilities and agentic risk

Overview

The CNC quoting functionality mostly matches its purpose, but the package includes unsafe publishing/install guidance and under-disclosed handling of sensitive CAD, quote, and customer data.

Review carefully before installing or running. Do not upload proprietary, regulated, export-controlled, or customer-owned CAD files to the public demo unless you understand the operator's data handling. Prefer local models for sensitive work, avoid the curl-to-sh Ollama install pattern, configure cloud providers and Feishu webhooks only for approved data, and do not run scripts/push_to_remotes.sh unless you intend to force-push the publisher's repositories with your tokens.

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
scripts/push_to_remotes.sh:30
Finding

Unconfirmed Force-Push Can Overwrite Remote Repository History

Content
View full analysis

Vulnerability Details

File Location: scripts/push_to_remotes.sh, lines 30–38
Vulnerability Type: Destructive repository operation without enforced confirmation
Risk Level: Medium

Complete Code Snippet

bash
if [ -n "$GITHUB_TOKEN" ]; then
    echo "Pushing to GitHub..."
    git push github master --force 2>&1 | grep -v "ghp_" || true
    echo "✅ Pushed to GitHub"
fi

if [ -n "$GITEE_TOKEN" ]; then
    echo "Pushing to Gitee..."
    git push gitee master --force 2>&1 | grep -v "cf343" || true

Technical Analysis

The publishing script unconditionally uses git push --force whenever the corresponding repository token is present. It does not require a dedicated force-push confirmation flag, perform a dry run, verify the expected remote state, or use --force-with-lease.

A force-push permits the local master branch to replace remote branch history even when the remote contains commits absent from the local checkout. Token presence is treated as sufficient authorization for this destructive operation, although possession of a publishing token does not necessarily imply authorization to discard intervening remote changes.

The pipeline also ends with || true, suppressing failures from git push or grep. The script then prints a success message regardless of the real push result, which can mislead an operator or automation system about whether publication succeeded.

This is high-risk behavior rather than evidence of malicious intent.

Attack Path

  1. A user or agent configures GITHUB_TOKEN or GITEE_TOKEN with write access to the hardcoded repository.
  2. The remote master branch acquires commits that are not present in the local checkout, whether through another contributor, CI automation, or an outdated local clone.
  3. The user or agent invokes scripts/push_to_remotes.sh.
  4. The script creates an authenticated remote using the configured token.
  5. The unconditional --force push replaces the remote branch refer ...[truncated 1067 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove --force and use a normal push for routine publishing.
  • If history replacement is an explicit requirement, use --force-with-lease so the operation fails when the remote branch has changed unexpectedly.
  • Require an explicit destructive-operation flag such as --confirm-force, and display the exact repository, branch, and commit transition before proceeding.
  • Fetch the remote branch and verify its current commit before attempting a history-changing push.
  • Respect repository branch-protection controls and use a dedicated release branch or pull-request workflow where practical.
  • Remove || true; preserve and return the actual push exit status.
  • Print success only after confirming that git push exited successfully.
  • Avoid embedding tokens in persistent Git remote URLs. Prefer a credential helper or temporary authenticated invocation, and remove temporary authenticated remotes after use.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (43)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · core/hybrid_retriever.py (reported line 384)May include surrounding context.

python
# 如果向量不可用,直接返回规则结果
        if not vector_result.success:
            rule_result.mode_used = "hybrid (rule only)"
            return rule_result
        
        # 加权融合
        rule_weight = self.config.get("rule_weight", 0.5)

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The documentation instructs users to pipe a remotely fetched script directly into a shell, which executes unreviewed code from the network immediately on the local system. If the remote server, CDN, DNS, TLS trust chain, or script distribution is compromised, users could run arbitrary attacker-controlled code.

Content

Scanner excerpt · docs/PROVIDERS.md (reported line 77)May include surrounding context.

bash
# 安装 Ollama
curl -fsSL https://ollama.com/install.sh | sh

# 拉取模型
ollama pull qwen2.5:0.5b  # 小模型,快

Chaining Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

The '| sh' construct is specifically dangerous because it chains network retrieval directly into command execution with no opportunity for inspection or integrity verification. This materially increases exploitability and lowers the barrier for supply-chain compromise to become full local code execution.

Content

Scanner excerpt · docs/PROVIDERS.md (reported line 77)May include surrounding context.

bash
# 安装 Ollama
curl -fsSL https://ollama.com/install.sh | sh

# 拉取模型
ollama pull qwen2.5:0.5b  # 小模型,快

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

Using git push ... --force can overwrite remote branch history and discard others' commits, making it a destructive operation with significant integrity impact. In this script, the risk is amplified because it targets authenticated remotes automatically and suppresses output patterns, making accidental or unauthorized destructive publication harder to notice quickly.

Content

Scanner excerpt · scripts/push_to_remotes.sh (reported line 32)May include surrounding context.

sh
# 推送到远程
if [ -n "$GITHUB_TOKEN" ]; then
    echo "Pushing to GitHub..."
    git push github master --force 2>&1 | grep -v "ghp_" || true
    echo "✅ Pushed to GitHub"
fi

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

This force-push to the Gitee remote carries the same destructive risk of rewriting history and deleting remote commits. Because the script is intended to run with credentials from environment variables and proceeds automatically, a mistaken invocation can immediately damage the remote repository state.

Content

Scanner excerpt · scripts/push_to_remotes.sh (reported line 38)May include surrounding context.

sh
if [ -n "$GITEE_TOKEN" ]; then
    echo "Pushing to Gitee..."
    git push gitee master --force 2>&1 | grep -v "cf343" || true
    echo "✅ Pushed to Gitee"
fi

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README encourages users to upload STEP/STL design files to a public demo endpoint but does not warn that such files may contain sensitive intellectual property, customer data, or export-controlled technical information. For a CNC quoting service, uploaded CAD models are often highly confidential, so omission of privacy, retention, and data-handling disclosures creates a real risk of unintended data exposure or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill advertises an online demo for a CNC quoting system that likely requires users to upload STEP/STL design files, but it does not warn that such files may contain proprietary or export-controlled manufacturing data. This omission can lead users to submit sensitive intellectual property to a third-party service without understanding the confidentiality and data-handling risks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The module title and all user-visible natural-language strings are written in Chinese, with no indication that language choice is optional or configurable. This can constitute a language/locale policy violation if the skill is expected to support user choice rather than force a specific language.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · core/config.py (reported line 22)May include surrounding context.

python
"openai": {
            "name": "OpenAI",
            "env_key": "OPENAI_API_KEY",
            "base_url": "https://api.openai.com/v1",
            "models": ["gpt-3.5-turbo", "gpt-4"]
        },
        "deepseek": {

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · core/config.py (reported line 28)May include surrounding context.

python
"deepseek": {
            "name": "DeepSeek",
            "env_key": "DEEPSEEK_API_KEY",
            "base_url": "https://api.deepseek.com/v1",
            "models": ["deepseek-chat", "deepseek-coder"]
        },
        "zhipu": {

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · core/config.py (reported line 40)May include surrounding context.

python
"moonshot": {
            "name": "Moonshot (月之暗面)",
            "env_key": "MOONSHOT_API_KEY",
            "base_url": "https://api.moonshot.cn/v1",
            "models": ["moonshot-v1-8k", "moonshot-v1-32k"]
        },
        "local": {

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The code makes an outbound HTTP request to a configurable API URL with an Authorization bearer token, creating a data exfiltration and secret exposure risk if the endpoint is untrusted or misconfigured. Because the destination is not validated in this file, a malicious or compromised configuration could cause API keys and request contents to be sent to an attacker-controlled service.

Content

Scanner excerpt · core/hybrid_retriever.py (reported line 100)May include surrounding context.

python
try:
            import requests
            response = requests.post(
                f"{self.api_url}/embeddings",
                headers={
                    "Authorization": f"Bearer {self.api_key}",

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The embedding request sends user-supplied text plus a bearer token to an external service, which can leak sensitive query contents and credentials if the endpoint is not trustworthy. In this retriever's context, inputs may encode proprietary pricing, materials, or manufacturing requirements, increasing the sensitivity of transmitted data.

Content

Scanner excerpt · core/hybrid_retriever.py (reported line 130)May include surrounding context.

python
try:
            import requests
            response = requests.post(
                f"{self.api_url}/embeddings",
                headers={
                    "Authorization": f"Bearer {self.api_key}",

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

User-provided query text is transmitted to an external embeddings API, which can disclose sensitive business or personal data to a third party. In this skill context, retrieval inputs may include proprietary manufacturing details, making outbound transmission more sensitive than in a generic public-search scenario.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module and class documentation describe a hybrid retriever that supports vector retrieval and elegant switching, and AUTO/HYBRID modes attempt to use that capability. However, the VectorRetriever.retrieve method is explicitly marked '待实现' and always returns an error, so the documented capability contradicts the actual behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The method persists quote data, including order identifiers, material, quantity, volume, pricing, and source, to both a unified database and a local SQLite database. Although the code logs that saving occurred, it does not provide any user-facing confirmation or warning that operational/customer data will be retained for history and RAG training purposes.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

At L0762-L0763, the inline comment/documentation states that K_Time and K_Risk have already been incorporated inside _calculate_machining_cost. However, _calculate_machining_cost at L1005-L1049 only uses setup cost, hourly rate, complexity, volume, and area, and never consumes either compensation factor. This is an active contradiction in code intent documentation, not merely an omitted detail.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code claims raw email text is desensitized, but in practice it only truncates the string before storing it in SQLite and forwarding snippets in notifications. Truncation does not remove names, contact details, addresses, pricing details, or other sensitive content, so sensitive data may be retained locally and disclosed to admins or downstream systems.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This code performs an outbound HTTP POST to a configurable webhook, transmitting alert payloads that may include customer and order text. External transmission is expected functionality for notifications, but it is still security-relevant because sensitive data can leave the trust boundary if the webhook is misconfigured, compromised, or points to an unapproved endpoint.

Content

Scanner excerpt · core/risk_control.py (reported line 507)May include surrounding context.

python
card = self._build_generic_card(alert_data)
        
        try:
            response = requests.post(self.feishu_webhook, json=card, timeout=10)
            if response.status_code == 200:
                logger.info(f"飞书通知发送成功:{alert_data.get('task_id')}")
            else:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Administrator alerts send order and customer-derived content, including raw text snippets, to an external Feishu webhook. This creates a data-sharing path to a third-party service without evidence in this file of consent, classification checks, or content minimization, increasing the risk of privacy leakage or regulatory noncompliance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The file's natural-language descriptions and user-facing strings are entirely in Chinese, indicating a fixed language/locale experience. The file does not offer any language choice or explain that the skill is intentionally limited to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code directly references files under a user's downloads directory in the test harness, which is a form of local file access to potentially sensitive user data. There is no accompanying warning, confirmation, or explanatory comment near the access informing the user that local downloaded documents will be read.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document encourages use of multiple cloud LLM providers and shows API key setup, but it does not warn that prompts, documents, and other inputs may be transmitted to third-party services when remote providers are selected. In a tool handling potentially sensitive CNC or user data, this omission can mislead users into unsafe deployment choices and cause unintended data exposure.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The comment at L15 says '添加远程仓库' ('add remote repositories'), which frames this section as configuration only. However, the script's documented flow and subsequent logic perform destructive network-side actions via git push ... --force at L32 and L38, which is materially more impactful than merely adding remotes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script performs destructive --force pushes to remote repositories without any confirmation prompt, dry-run mode, or explicit warning. In an agent or automation context, this increases the risk of accidental history rewrites, loss of commits, and unintended publication of local state to public remotes.

Content

No source excerpt is available for this finding.