Back to skill

Security audit

open-webui-api 操作技能

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate Open WebUI integration purpose, but it needs review because it can transmit files, prompts, and API tokens over plaintext or to an unintended default network address.

Review before installing. Use this only with a trusted Open WebUI endpoint, prefer HTTPS, avoid the shell helper's default LAN URL, use a least-privilege API token, and do not upload sensitive documents unless you understand the server's retention, access, and deletion controls.

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

Error
Location
claw-openwebui.sh:5
Finding

Bearer tokens and sensitive user content may be transmitted over plaintext HTTP

Content
View full analysis

Vulnerability Details

File Location: claw-openwebui.sh:5, claw-openwebui.sh:139-142, claw-openwebui.sh:189-192, scripts/upload.py:44-53, scripts/chat.py:42-48, scripts/search.py:48-54, scripts/list_files.py:33-38, SKILL.md:44-45, README.md:42-43
Vulnerability Type: Plaintext transmission of credentials and sensitive content
Risk Level: High

Vulnerable Code

claw-openwebui.sh:5 assigns a plaintext HTTP endpoint, including a hard-coded LAN host, when the URL environment variable is absent:

bash
WEBUI_URL="${OPENWEBUI_URL:-http://192.168.0.176:3000}"

claw-openwebui.sh:139-142 sends the API bearer token and the complete selected file to that endpoint:

bash
local upload_response=$(curl -s -X POST "$WEBUI_URL/api/v1/files/" \
    -H "Authorization: Bearer $API_KEY" \
    -H "Accept: application/json" \
    -F "file=@$file_path")

claw-openwebui.sh:189-192 performs the same sensitive transmission in the standalone upload operation:

bash
local response=$(curl -s -X POST "$WEBUI_URL/api/v1/files/" \
    -H "Authorization: Bearer $API_KEY" \
    -H "Accept: application/json" \
    -F "file=@$file_path")

scripts/upload.py:44-53 trusts the user-controlled URL without requiring HTTPS and transmits both the token and file:

python
with open(file_path, 'rb') as f:
    files = {
        'file': (file_name, f)
    }
    response = requests.post(
        f"{config['url']}/api/v1/files/upload",
        headers=headers,
        files=files,
        timeout=60
    )

Similar URL construction and authenticated requests are used for chat messages, RAG search queries, and file listings:

python
response = requests.post(
    f"{config['url']}/api/v1/chat/completions",
    headers=headers,
    json=payload,
    timeout=60
)
python
response = requests.post(
    f"{config['url']}/api/v1/rag",
    headers=h
...[truncated 3468 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require HTTPS by default. Parse OPENWEBUI_URL and reject any scheme other than https:// before attaching credentials or transmitting content.

    python
    from urllib.parse import urlparse
    
    parsed = urlparse(url)
    if parsed.scheme != "https":
        raise ValueError("OPENWEBUI_URL must use HTTPS")
    
  2. Fail closed when configuration is absent. Remove the hard-coded LAN fallback from claw-openwebui.sh:

    bash
    WEBUI_URL="${OPENWEBUI_URL:-}"
    
    if [ -z "$WEBUI_URL" ]; then
        echo "Error: OPENWEBUI_URL must be set" >&2
        exit 1
    fi
    
  3. Permit plaintext only through an explicit development override. If localhost HTTP support is operationally necessary, require a clearly named option such as OPENWEBUI_ALLOW_INSECURE_HTTP=true, restrict it to loopback destinations, and display a prominent warning. Do not permit insecure remote or LAN destinations by default.

  4. Preserve certificate verification. Continue using the default TLS verification behavior in requests. Do not introduce verify=False or curl's --insecure. Document how administrators should deploy a trusted certificate or configure an appropriate private certificate authority.

  5. Validate the destination before opening files. Perform scheme and host validation before reading an upload path so sensitive local content is never opened for an invalid or disallowed destination.

  6. Correct the documentation. Replace all recommended http:// examples with https:// examples. If loopback-only development examples remain, clearly state that they must not be used across a network.

  7. Reduce token exposure and scope. Use a dedicated, minimally privileged Open WebUI token for this Skill, rotate it regularly, and revoke it immediately after suspected interception.

  8. Add explicit upload confirmation. Before transmitting a file, display the normalized destination ho ...[truncated 139 chars]

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (19)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README encourages uploading files into a RAG knowledge base but does not warn that uploaded content may be retained, indexed, exposed to other authorized users, or later surfaced in model responses. In a skill that handles API-driven knowledge base operations, this omission can lead users to submit sensitive documents without understanding the disclosure and persistence risks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list contains broad terms like "openwebui", "rag", "知識庫", and upload/search phrases that could match ordinary user conversation and cause the skill to activate unexpectedly. Because this skill can send queries and files to an external Open WebUI service, over-broad activation increases the chance of unintended data disclosure or accidental remote actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill documentation describes uploading documents, searching, and chat usage but does not clearly warn that user files and queries are transmitted to an external Open WebUI instance. This omission can cause users to share sensitive local content without informed consent, especially when the configured server may be remote or self-hosted on another machine.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · SKILL.md (reported line 189)May include surrounding context.

md
# 搜尋知識庫
def search\\\_knowledge(query):
    response = requests.post(
        f"{OPENWEBUI\\\_URL}/api/v1/rag",
        headers=headers,
        json={"query": query}

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · claw-openwebui.sh (reported line 55)May include surrounding context.

sh
return 1
    fi
    
    curl -s -X POST "$WEBUI_URL/api/chat/completions" \
        -H "Authorization: Bearer $API_KEY" \
        -H "Content-Type: application/json" \
        -d "{\"model\": \"$model\", \"messages\": [{\"role\": \"user\", \"content\": \"$message\"}], \"stream\": false}" | \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script sends the user's chat message to a remote API and also includes functions that upload local files to the server. While the script prints status messages for some operations, it does not clearly warn the user that their message contents and selected file contents will be transmitted off-host to the configured Open WebUI instance.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · claw-openwebui.sh (reported line 84)May include surrounding context.

sh
return 1
    fi
    
    local response=$(curl -s -X POST "$WEBUI_URL/api/v1/knowledge/" \
        -H "Authorization: Bearer $API_KEY" \
        -H "Content-Type: application/json" \
        -d "{\"name\": \"$name\", \"description\": \"$description\"}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The upload-to-knowledge flow posts a local file to the remote Open WebUI API and adds it into a knowledge base, which can materially affect user data privacy. The script announces that it is uploading, but it does not warn that file contents leave the local system and may be stored or indexed remotely.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · claw-openwebui.sh (reported line 162)May include surrounding context.

sh
# 添加到知識庫
    echo -e "${YELLOW}📚 添加到知識庫...${NC}"
    
    local add_response=$(curl -s -X POST "$WEBUI_URL/api/v1/knowledge/$knowledge_id/file/add" \
        -H "Authorization: Bearer $API_KEY" \
        -H "Content-Type: application/json" \
        -d "{\"file_id\": \"$file_id\"}")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language description and user-facing strings in this script are written in Traditional Chinese, and the skill does not offer any language selection or indicate that the locale restriction is intentional. Under the policy, forcing a specific language without user opt-in is a locale-policy violation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · scripts/chat.py (reported line 44)May include surrounding context.

python
}
    
    try:
        response = requests.post(
            f"{config['url']}/api/v1/chat/completions",
            headers=headers,
            json=payload,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code sends the user-provided message to a remote Open WebUI endpoint and explicitly enables include_rag_context, which may transmit additional knowledge-base context. While the script prints the message being processed, it does not clearly warn the user that their prompt and RAG-related data will be sent over the network to an external service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring is written entirely in Traditional Chinese, which indicates the skill is presented in a fixed language without any visible opt-in or alternative locale. The policy explicitly calls for flagging language or locale constraints when the skill forces a specific language without user choice.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · scripts/search.py (reported line 49)May include surrounding context.

python
payload["collection_name"] = collection_name
    
    try:
        response = requests.post(
            f"{config['url']}/api/v1/rag",
            headers=headers,
            json=payload,

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language invocation examples and overall user instructions are presented only in Chinese, implying a fixed interaction language for the skill. The policy requires either user choice/opt-in or a clearly justified locale constraint; neither is stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

All user-facing help, status, and error messages are presented in Chinese, and the script does not offer any language selection or explain that it is intended only for a Chinese-speaking environment. This can violate language or locale policy where user-facing tools must not force a specific language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains natural-language strings exclusively in Chinese, including the module description, CLI description, help text, and error messages. Because the skill does not offer any user language selection or explain that it is intentionally limited to a Chinese-speaking audience, it may violate a language/locale policy requiring opt-in or documented justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring says this is an 'Open WebUI file upload script', which conveys a single-purpose upload utility. However, the code also defines and exposes list_files() and a --list CLI mode that retrieves previously uploaded files from the remote service, expanding the script's behavior beyond upload-only semantics.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file contains user-facing descriptions, help text, and status/error messages exclusively in Chinese, including the module docstring and CLI argument descriptions. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.