Back to skill

Security audit

vispatrol-alarm-query

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed VisPatrol alarm-query integration, but it handles surveillance credentials and images with weak enforcement and unsafe network boundaries that users should review before installing.

Install only on a trusted Windows VisPatrol host after confirming vpup.json is expected and the VisPatrol services are local or otherwise protected. Be aware that the skill decrypts and uses a local session token, can save camera snapshots to disk, and currently relies on user/agent discipline rather than code-level approval checks; it should be hardened before use in environments where network attackers, untrusted VisPatrol responses, or sensitive retention rules are a concern.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/alarm_query.py:750
Finding

Bearer Token Forwarded to Unvalidated Snapshot URLs

Content
View full analysis
str: """将抓拍地址规范化为可下载的绝对 URL。""" if not snapshot_url: return snapshot_url parsed = urlparse(snapshot_url) if parsed.scheme and parsed.netloc: return snapshot_url return urljoin( f"{self._build_service_base_url(self.config.media_service_port).rstrip('/')}/", snapshot_url.lstrip("/") ) ``` ```python def _materialize_snapshot_from_url(self, snapshot: Dict[str, Any]) -> Optional[str]: """将抓拍 URL 下载到本地,供上层发送图片。""" local_path = snapshot.get("local_path") if local_path not in (None, ""): return None snapshot_url = snapshot.get("url") if snapshot_url in (None, ""): return None resolved_url = self._resolve_snapshot_url(str(snapshot_url)) headers = {} if self.token: headers["Authorization"] = f"Bearer {self.token}" try: response = self.session.get( resolved_url, headers=headers, timeout=self.config.timeout ) response.raise_for_status() ``` ### Technical Analysis The media API can return a snapshot URL. When that URL is absolute, `_resolve_snapshot_url()` accepts it without validating its scheme, hostname, port, or relationship to the configured VisPatrol media service. The subsequent request attaches the decrypted VisPatrol bearer token regardless of the resolved destination. Consequently, a compromised or malicious API response can cause an authenticated request to an attacker-controlled origin. The same primitive can be used for SSRF against internal services reachable from the host. The default `requests` behavior also follows redirects. Even if the initial URL were validated, an unvalidated redirect c ...[truncated 1216 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/alarm_query.py:263
Finding

Credential File Access and Token Decryption Are Not Programmatically Approval-Gated

Content
View full analysis
Dict[str, Any]: """从 Windows 临时目录中的 vpup.json 加载服务地址、token 和 tokenKey。""" if self.runtime_config_loaded and not force_reload: return { "success": True, "message": "已加载 vpup 配置", "data": { "base_url": self.config.base_url, "alarm_service_port": self.config.alarm_service_port, "media_service_port": self.config.media_service_port, "token_loaded": bool(self.token), } } vpup_path = _resolve_vpup_config_path(self.config.vpup_config_path) try: raw_text = vpup_path.read_text(encoding="utf-8-sig") payload = json.loads(raw_text) ``` ```python token = payload.get("token", "") cpu_mac = get_cpu_id() cpu_mac = hashlib.md5(cpu_mac.encode("ascii")).hexdigest().upper() ``` ```python try: decrypted_token = aes_cbc_decrypt(token, cpu_mac, "") except ValueError as exc: message = f"vpup.json 中的 token 解密失败: {exc}" ``` ```python # 创建查询实例 alarm_query = AlarmQuery(config) ``` ### Technical Analysis `SKILL.md` and `SECURITY.md` state that access to `%TEMP%/vpup.json` must be explicitly approved before each run. However, the Python implementation has no approval parameter or trusted configuration check. Constructing `AlarmQuery` immediately invokes `_load_runtime_config_from_vpup()`. ...[truncated 1493 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/alarm_query.py:366
Finding

Bearer Authentication and Surveillance Data Transmitted over Plaintext HTTP

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:68
Finding

Runtime Dependencies Are Installed without Version or Integrity Pinning

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims approval-gated, read-only querying, but the described behavior includes automatic reading of a local credential-bearing file, host identifier collection for token decryption, authenticated remote API access, local image writes, and subprocess execution to inspect the environment. This mismatch is dangerous because it expands trust from a simple 'query skill' into a credential-handling agent with host introspection and external communications, while the claimed approval boundary appears to be documented but not technically enforced by the skill manifest.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 该 token 只允许用于 scripts/alarm_query.py 已实现的只读报警查询和抓拍读取;禁止将其用于登录、账号管理、设备控制、配置修改或其他无关接口。

Scope Creep

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill metadata says file access is limited to reading %TEMP%/vpup.json, but the code also writes snapshot files into ~/.openclaw/workspace/tmp_files/ or a caller-specified directory. This is a scope-expansion issue: the implementation exceeds the declared file permissions and can persist potentially sensitive camera images outside the approved location.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Although the skill is described as performing read-only alarm and snapshot queries, it downloads snapshot data and writes image files to local storage. This violates the declared behavior and creates a real data-handling risk because surveillance imagery may be persisted on disk without the user's informed approval or awareness.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares powerful capabilities—environment access, file read/write, network access, and shell/subprocess usage—but does not constrain them with an explicit tool scope such as permissions or allowed-tools. Even though the markdown text describes intended limits, those are policy statements rather than enforceable sandbox controls, so the runtime may permit broader access than users or reviewers expect.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code executes host commands and derives a machine identifier from the MAC address to decrypt the token, which goes beyond a simple read-only query operation. In this skill context, collecting system-identifying data is sensitive because it is not clearly disclosed as a prerequisite and enlarges the trust boundary from reading a config file to fingerprinting the local host.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
77% confidence
Finding

The code executes Windows host commands from WSL (cmd.exe/powershell.exe) to discover the host TEMP directory, expanding its reach across the guest-host boundary. In the skill context, this is more dangerous because the manifest claims a narrowly scoped, approval-gated read of %TEMP%/vpup.json, but the implementation actively probes host environment details using subprocesses without an explicit in-code consent check.

Content

Scanner excerpt · scripts/alarm_query.py (reported line 69)May include surrounding context.

python
for command in commands:
        try:
            completed = subprocess.run(
                command,
                capture_output=True,
                text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/alarm_query.py (reported line 154)May include surrounding context.

python
return None

    try:
        completed = subprocess.run(
            ["getmac", "/fo", "csv", "/nh"],
            capture_output=True,
            text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The code accesses host-identifying data by retrieving the MAC address and transforming it into a decryption key, without clear disclosure at the point of use. In the skill context, this is problematic because the stated permission model focuses on reading %TEMP%/vpup.json, not collecting machine identity data as an extra prerequisite.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Snapshot files are materialized locally without any user-facing warning, prompt, or confirmation inside the code path. Given the sensitive nature of surveillance images, silent persistence increases privacy and data-retention risk even if the original query was user-initiated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Natural-language strings in the module docstring, CLI descriptions, and output messages are consistently Chinese-only, which can effectively force a specific language on users. The file does not offer language selection or state that the tool is intentionally limited to a Chinese-speaking or region-specific environment.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

函数 _normalize_alarm_records 的文档说明声称只保留有限展示字段,但其调用的 _normalize_alarm_record 实际会保留 id、device_id、channel,并在后续流程中附加 snapshot 与 snapshot_error。该注释对数据保留范围的描述与实际行为不一致,可能误导审计者对输出内容和后续抓拍关联逻辑的理解。

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/alarm_query.py (reported line 1529)May include surrounding context.

python
def configure_console_output():
    """尽量启用 UTF-8 控制台输出,避免 Windows 默认编码导致打印失败。"""
    for stream_name in ("stdout", "stderr"):
        stream = getattr(sys, stream_name, None)
        reconfigure = getattr(stream, "reconfigure", None)
        if callable(reconfigure):
            try: