Back to skill

Security audit

Closeli Open Device Live Query

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated device-live purpose, but it handles a sensitive API key from a shared persistent file and can send it to a configurable gateway with TLS verification disabled.

Review before installing. Use a least-privilege API key, keep AI_GATEWAY_VERIFY_SSL enabled, verify AI_GATEWAY_HOST is the intended trusted Closeli gateway, and ensure ~/.openclaw/.env is readable only by the intended OpenClaw service user. Avoid using this skill in environments where unrelated skills can modify the shared configuration file.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
get_live_url.py:77
Finding

Bearer Credential Exfiltration Through Unrestricted Gateway Configuration and Optional TLS Bypass

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Note
Location
get_live_url.py:37
Finding

Overbroad Parsing of a Shared Multi-Skill Credential File

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (18)

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The skill depends on a shared persistent credential file ~/.openclaw/.env containing AI_GATEWAY_API_KEY, and the document explicitly notes that all skills under the same user can read it. That creates a cross-skill credential exposure path where any compromised or overly broad skill can steal the API key and access device-related APIs.

Content

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

md
openclaw:
    requires:
      bins: ["python3"]
      configPaths: ["~/.openclaw/.env"]
    primaryEnv: "AI_GATEWAY_API_KEY"
---

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 · SKILL.md (reported line 16)May include surrounding context.

md
`POST /api/device/live` is used to obtain the H5 player live link for a specified device. The API verifies device ownership and then returns a player URL that can be opened directly in a browser.

## ⚠️ Display Rules (MUST be strictly followed)

The script outputs structured data in JSON format, which is the expected behavior. The display rules below are formatting instructions for the agent: the agent MUST parse the JSON output from the script, convert it into a user-friendly format according to the following rules before displaying it, and MUST NOT display the raw JSON directly.

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 · SKILL.md (reported line 18)May include surrounding context.

md
## ⚠️ Display Rules (MUST be strictly followed)

The script outputs structured data in JSON format, which is the expected behavior. The display rules below are formatting instructions for the agent: the agent MUST parse the JSON output from the script, convert it into a user-friendly format according to the following rules before displaying it, and MUST NOT display the raw JSON directly.

The script output includes the `_device_name` field (device name), which is used for display.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 10)May include surrounding context.

python
获取指定设备的 H5 播放器直播链接。自动调用 device/list 获取设备名称。

配置来源(统一规则):
  - 持久化:~/.openclaw/.env (OpenClaw 客户端的"设置 API Key"会自动写入此文件)
  - 临时覆盖:仅 API_KEY 支持命令行 --api-key,覆盖 .env 中的同名配置
  - 不再读取任何 AI_GATEWAY_* 环境变量

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 11)May include surrounding context.

python
获取指定设备的 H5 播放器直播链接。自动调用 device/list 获取设备名称。

配置来源(统一规则):
  - 持久化:~/.openclaw/.env (OpenClaw 客户端的"设置 API Key"会自动写入此文件)
  - 临时覆盖:仅 API_KEY 支持命令行 --api-key,覆盖 .env 中的同名配置
  - 不再读取任何 AI_GATEWAY_* 环境变量

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 39)May include surrounding context.

python
获取指定设备的 H5 播放器直播链接。自动调用 device/list 获取设备名称。

配置来源(统一规则):
  - 持久化:~/.openclaw/.env (OpenClaw 客户端的"设置 API Key"会自动写入此文件)
  - 临时覆盖:仅 API_KEY 支持命令行 --api-key,覆盖 .env 中的同名配置
  - 不再读取任何 AI_GATEWAY_* 环境变量

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 67)May include surrounding context.

python
获取指定设备的 H5 播放器直播链接。自动调用 device/list 获取设备名称。

配置来源(统一规则):
  - 持久化:~/.openclaw/.env (OpenClaw 客户端的"设置 API Key"会自动写入此文件)
  - 临时覆盖:仅 API_KEY 支持命令行 --api-key,覆盖 .env 中的同名配置
  - 不再读取任何 AI_GATEWAY_* 环境变量

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 76)May include surrounding context.

python
获取指定设备的 H5 播放器直播链接。自动调用 device/list 获取设备名称。

配置来源(统一规则):
  - 持久化:~/.openclaw/.env (OpenClaw 客户端的"设置 API Key"会自动写入此文件)
  - 临时覆盖:仅 API_KEY 支持命令行 --api-key,覆盖 .env 中的同名配置
  - 不再读取任何 AI_GATEWAY_* 环境变量

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 85)May include surrounding context.

python
获取指定设备的 H5 播放器直播链接。自动调用 device/list 获取设备名称。

配置来源(统一规则):
  - 持久化:~/.openclaw/.env (OpenClaw 客户端的"设置 API Key"会自动写入此文件)
  - 临时覆盖:仅 API_KEY 支持命令行 --api-key,覆盖 .env 中的同名配置
  - 不再读取任何 AI_GATEWAY_* 环境变量

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 129)May include surrounding context.

python
获取指定设备的 H5 播放器直播链接。自动调用 device/list 获取设备名称。

配置来源(统一规则):
  - 持久化:~/.openclaw/.env (OpenClaw 客户端的"设置 API Key"会自动写入此文件)
  - 临时覆盖:仅 API_KEY 支持命令行 --api-key,覆盖 .env 中的同名配置
  - 不再读取任何 AI_GATEWAY_* 环境变量

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 134)May include surrounding context.

python
获取指定设备的 H5 播放器直播链接。自动调用 device/list 获取设备名称。

配置来源(统一规则):
  - 持久化:~/.openclaw/.env (OpenClaw 客户端的"设置 API Key"会自动写入此文件)
  - 临时覆盖:仅 API_KEY 支持命令行 --api-key,覆盖 .env 中的同名配置
  - 不再读取任何 AI_GATEWAY_* 环境变量

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 137)May include surrounding context.

python
获取指定设备的 H5 播放器直播链接。自动调用 device/list 获取设备名称。

配置来源(统一规则):
  - 持久化:~/.openclaw/.env (OpenClaw 客户端的"设置 API Key"会自动写入此文件)
  - 临时覆盖:仅 API_KEY 支持命令行 --api-key,覆盖 .env 中的同名配置
  - 不再读取任何 AI_GATEWAY_* 环境变量

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 42)May include surrounding context.

python
从 ~/.openclaw/.env 文件加载配置。
    这是 OpenClaw 客户端写入的持久化真值源,由所有 skill 共享。
    """
    env_path = Path.home() / ".openclaw" / ".env"
    if not env_path.exists():
        return {}
    result = {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · get_live_url.py (reported line 125)May include surrounding context.

python
从 ~/.openclaw/.env 文件加载配置。
    这是 OpenClaw 客户端写入的持久化真值源,由所有 skill 共享。
    """
    env_path = Path.home() / ".openclaw" / ".env"
    if not env_path.exists():
        return {}
    result = {}

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares network and file-read capabilities implicitly but does not define an explicit tool/permission scope. In an agent environment, missing scope boundaries can let the runtime grant broader access than intended, increasing the blast radius if the skill is misused or the implementation changes.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
92% confidence
Finding

The skill intentionally uses a single persistent shared .env file as the authoritative configuration source and ignores process environment overrides. This creates session persistence for credentials and host settings across runs and across skills, so stale, poisoned, or maliciously modified values can silently affect future executions.

Content

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

md
### Configuration Source

The script reads `~/.openclaw/.env` as the single persistent configuration source. This file is shared by all skills and uses the format `KEY=VALUE` (one entry per line). OpenClaw clients write to this file when the user updates settings. The script does NOT read any `AI_GATEWAY_*` environment variables — env variables are intentionally ignored to avoid stale Gateway-process snapshots overriding the user's latest config.

## Security Notes

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
## Security Notes

- The shared credential file `~/.openclaw/.env` is readable by all skills under the same user. Ensure file permissions are restricted (e.g. `chmod 600 ~/.openclaw/.env`) and that only the OpenClaw service user has access. The IM clients write to this file under that user's home directory.
- TLS certificate verification is enabled by default. You MUST NOT disable it in production environments (disabling it introduces man-in-the-middle attack risks, and attackers may intercept API_KEY and device data)
- Before use, you MUST confirm that AI_GATEWAY_HOST points to a trusted domain
- You MUST use a least-privilege API_KEY to avoid reusing high-privilege credentials. This skill only requires permission to retrieve device live links

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
94% confidence
Finding

The script allows TLS certificate verification to be disabled via shared configuration, which can expose the Authorization bearer token and device live-stream traffic to man-in-the-middle attacks. Because this skill returns live playback links for device feeds, interception or tampering could lead to unauthorized surveillance access or credential compromise, making the context more sensitive than a generic API client.

Content

Scanner excerpt · get_live_url.py (reported line 85)May include surrounding context.

python
def get_verify_ssl(env_vars):
    """
    判断是否启用 TLS 证书验证。默认启用。
    仅当 ~/.openclaw/.env 中显式设置 AI_GATEWAY_VERIFY_SSL=false 时禁用(仅开发环境)。
    """
    val = env_vars.get("AI_GATEWAY_VERIFY_SSL", "true").lower()
    return val not in ("false", "0", "no")