Back to skill

Security audit

Ezviz Open Camera Config

Security checks for vulnerabilities and agentic risk

Overview

The skill performs the advertised Ezviz device configuration work, but its token handling can persist sensitive access tokens even when users are told caching is disabled.

Review this skill before installing in shared or high-security environments. Use dedicated least-privilege Ezviz credentials, avoid passing secrets on the command line, assume access tokens may be cached under the system temp directory even if EZVIZ_TOKEN_CACHE=0 is set, and clear or isolate that cache after use.

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

T09 · Insecure Skill Coding Practices

Warning
Location
lib/token_manager.py:125
Finding

Token cache opt-out does not prevent access-token persistence

Content
View full analysis
8 else app_key } if save_token_cache(all_cache): print(f"[INFO] Token saved to global cache") ``` ### Technical Analysis The `use_cache` setting controls only whether ...[truncated 1997 chars]
Remediation
View remediation
8 else app_key, } save_token_cache(all_cache) ``` 3. When caching is disabled, avoid calling `load_token_cache()`, creating the cache directory, or writing any token-related file. 4. Add automated tests asserting that `EZVIZ_TOKEN_CACHE=0` causes no cache file or directory to be created or modified. 5. Add a regression test covering all documented false values: `0`, `false`, `no`, and `disable`. 6. Harden enabled caching by creating the cache directory with mode `0700`, validating ownership, rejecting symbolic links, and creating temporary files securely with `tempfile.mkstemp()` before atomic replacement. 7. Correct the documentation only after implementation and tests confirm that disabling caching truly prevents persistence. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/device_config.py:272
Finding

Long-lived application secrets are accepted through process command-line arguments

Content
View full analysis
1 else app_key app_secret = app_secret or sys.argv[2] if len(sys.argv) > 2 else app_secret ``` The token-manager CLI provides an additional command-line secret input: ```python parser.add_argument("--app-key", help="Ezviz app key") parser.add_argument("--app-secret", help="Ezviz app secret") ``` ### Technical Analysis Command-line arguments are not an appropriate transport for long-lived application secrets. Depending on the operating system and execution environment, command lines can be exposed through: - Process inspection interfaces and utilities. - Shell history files. - Audit and endpoint-monitoring logs. - CI/CD job metadata and build logs. - Container or orchestration inspection data. - Diagnostic reports and process crash telemetry. The project already supports environment variables and protected configuration files, so accepting the application secret through positional and optional command-line arguments is not necessary for the declared device-configuration functionality. The issue is particularly significant because `appSecret` is not merely a short-lived session value. An attacker who obtains it together with the application key can request new access tokens even after previously issued tokens expire. ### Attack Path 1. A user follows the documented invocation pattern and includes the Ezviz application key and secret directly in a command. 2. The shell records the command in history, or the running process exposes it through process metadata. 3. A local user, monitoring agent, log reader, CI operator, or compromised process retrieves the arguments. 4. The attacker extracts the application key ...[truncated 854 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The metadata and narrative say credentials must be set via environment variables, but the skill also reads fallback credentials from local OpenClaw config files and accepts CLI-supplied secrets. This mismatch can lead to unintended secret ingestion from unrelated local files or insecure invocation patterns, causing the skill to operate on credentials or devices the user did not mean to expose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The metadata and narrative say credentials must be set via environment variables, but the skill also reads fallback credentials from local OpenClaw config files and accepts CLI-supplied secrets. This mismatch can lead to unintended secret ingestion from unrelated local files or insecure invocation patterns, causing the skill to operate on credentials or devices the user did not mean to expose.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

cat /tmp/ezviz_global_token_cache/global_token_cache.json

清除缓存

rm -rf /tmp/ezviz_global_token_cache/

text

### 验证命令

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

cat /tmp/ezviz_global_token_cache/global_token_cache.json

清除缓存

rm -rf /tmp/ezviz_global_token_cache/

text

### 验证命令

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

cat /tmp/ezviz_global_token_cache/global_token_cache.json

清除缓存

rm -rf /tmp/ezviz_global_token_cache/

text

### 验证命令

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

cat /tmp/ezviz_global_token_cache/global_token_cache.json

清除缓存

rm -rf /tmp/ezviz_global_token_cache/

text

### 验证命令

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

2. 环境变量安全

bash
# 推荐:使用 .env 文件(不要提交到版本控制)
echo "EZVIZ_APP_KEY=your_key" >> .env
echo "EZVIZ_APP_SECRET=your_secret" >> .env
chmod 600 .env

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

2. 环境变量安全

bash
# 推荐:使用 .env 文件(不要提交到版本控制)
echo "EZVIZ_APP_KEY=your_key" >> .env
echo "EZVIZ_APP_SECRET=your_secret" >> .env
chmod 600 .env

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

2. 环境变量安全

bash
# 推荐:使用 .env 文件(不要提交到版本控制)
echo "EZVIZ_APP_KEY=your_key" >> .env
echo "EZVIZ_APP_SECRET=your_secret" >> .env
chmod 600 .env

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

2. 环境变量安全

bash
# 推荐:使用 .env 文件(不要提交到版本控制)
echo "EZVIZ_APP_KEY=your_key" >> .env
echo "EZVIZ_APP_SECRET=your_secret" >> .env
chmod 600 .env

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

2. 环境变量安全

bash
# 推荐:使用 .env 文件(不要提交到版本控制)
echo "EZVIZ_APP_KEY=your_key" >> .env
echo "EZVIZ_APP_SECRET=your_secret" >> .env
chmod 600 .env

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

md
def get_cached_token(app_key, app_secret, use_cache=None):
    """
    Get access token, using cached version if available and valid.
    
    Args:
        app_key: Ezviz app key

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

md
def get_cached_token(app_key, app_secret, use_cache=None):
    """
    Get access token, using cached version if available and valid.
    
    Args:
        app_key: Ezviz app key

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · lib/token_manager.py (reported line 121)May include surrounding context.

python
def get_cached_token(app_key, app_secret, use_cache=None):
    """
    Get access token, using cached version if available and valid.
    
    Args:
        app_key: Ezviz app key

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · lib/token_manager.py (reported line 190)May include surrounding context.

python
def get_cached_token(app_key, app_secret, use_cache=None):
    """
    Get access token, using cached version if available and valid.
    
    Args:
        app_key: Ezviz app key

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/device_config.py (reported line 158)May include surrounding context.

python
def get_cached_token(app_key, app_secret, use_cache=None):
    """
    Get access token, using cached version if available and valid.
    
    Args:
        app_key: Ezviz app key

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/device_config.py (reported line 309)May include surrounding context.

python
def get_cached_token(app_key, app_secret, use_cache=None):
    """
    Get access token, using cached version if available and valid.
    
    Args:
        app_key: Ezviz app key

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/device_config.py (reported line 311)May include surrounding context.

python
def get_cached_token(app_key, app_secret, use_cache=None):
    """
    Get access token, using cached version if available and valid.
    
    Args:
        app_key: Ezviz app key

Credential Access

High
Category
Privilege Escalation
Confidence
81% confidence
Finding

The refresh flow obtains a new API access token and persists it in a shared cache under the system temporary directory. Even though the file is chmod'ed to 0600, storing long-lived bearer tokens in a global temp-backed location increases the risk of token theft via local compromise, container/user sharing, insecure temp-dir semantics, or race conditions around file creation and replacement.

Content

Scanner excerpt · lib/token_manager.py (reported line 174)May include surrounding context.

python
def refresh_token(app_key, app_secret, cache_key=None):
    """
    Get new access token from Ezviz API and save to cache.
    
    Args:
        app_key: Ezviz app key

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The CLI prints the first 30 characters of the access token to stdout. Partial bearer-token disclosure is sensitive because terminals, shell history, CI logs, remote session recording, or monitoring systems may capture it, and many token schemes can be abused even with substantial partial leakage when combined with other exposure or predictable structure.

Content

Scanner excerpt · lib/token_manager.py (reported line 362)May include surrounding context.

python
result = get_cached_token(args.app_key, args.app_secret, use_cache=use_cache)
        
        if result["success"]:
            print(f"\nAccess Token: {result['access_token'][:30]}...")
            print(f"Expires: {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(result['expire_time'] / 1000))}")
            print(f"From Cache: {result['from_cache']}")
        else:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares broad capabilities in practice (environment access, file reads/writes, network use, and shell commands) but does not explicitly scope or constrain them with a permissions/allowed-tools declaration. That increases the blast radius for an agent invoking the skill, because operators cannot easily verify what sensitive resources the skill may touch before use.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation is internally contradictory about whether tokens persist across runs, while elsewhere repeatedly describing persistent token caching in a temp file. This kind of misleading security documentation can cause users to make incorrect trust decisions and mishandle credentials under the false assumption that no durable secret storage occurs.

Content

No source excerpt is available for this finding.

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 535)May include surrounding context.

md
# 推荐:使用 .env 文件(不要提交到版本控制)
echo "EZVIZ_APP_KEY=your_key" >> .env
echo "EZVIZ_APP_SECRET=your_secret" >> .env
chmod 600 .env

# 加载环境变量
source .env

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This file contains user-facing natural-language documentation such as the module title and feature description in Chinese, while other parts are in English. For an all-file-types language policy check, this effectively imposes a specific language on readers without opt-in or a stated region-specific justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The mapping documents several state-changing APIs that can directly alter security and privacy posture, including disarming devices, disabling privacy masking, enabling continuous recording, and changing motion detection sensitivity, but it does not clearly warn operators about those consequences. In a skill specifically intended for remote device configuration, this omission increases the chance of unsafe or unintended changes that weaken physical security or expose occupants’ activities.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.