Back to skill

Security audit

jf-open-pro-device-reboot

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to do what it claims, but it can reboot or shut down devices without mandatory confirmation and can send device-control credentials to any endpoint set in the environment.

Review this skill before installing. Use it only for devices you own or administer, keep the JF credentials and device token tightly scoped, set JF_ENDPOINT only to an official documented regional host, and require an explicit human confirmation immediately before any reboot or shutdown action.

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

Error
Location
scripts/device_reboot.py:25
Finding

Authentication Data and Device Token Can Be Redirected to an Arbitrary Endpoint

Content
View full analysis
Dict[str, str]: """Generate request headers containing the signature and timestamp.""" time_millis = get_time_millis() signature = generate_signature(uuid, app_key, app_secret, time_millis, move_card) return { "Content-Type": "application/json; charset=UTF-8", "uuid": uuid, "appKey": app_key, "timeMillis": time_millis, "signature": signature, "X-Request-Id": os.urandom(16).hex() } def device_reboot(device_token: str, uuid: str, app_key: str, app_secret: str, move_card: int, action: str = "Reboot") -> Dict[str, Any]: url = f"{JF_BASE_URL}/rtc/device/opdev/{device_token}" headers = get_headers(uuid, app_key, app_secret, move_card) body = { "Name": "OPMachine", "OPMachine": { "Action": action } } response = requests.post(url, headers=headers, json=body, timeout=30) ``` ### Technical Analysis The destination hostname is read directly from the `JF_ENDPOINT` environment variable and interpolated into an HTTPS URL without validation. Although HTTPS verifies the certificate for the selected hostname, it does not establish that the hostname belongs to the intended service provider. An attacker-controlled domain with a valid certificate would therefore be accepted. Each request transmits the following authentication-related data to the configured endpoint: - User UUID - Application key - Timestamp - Request signature derived from ...[truncated 2175 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/device_reboot.py:91
Finding

Disruptive Reboot and Shutdown Operations Execute Without Mandatory Confirmation

Content
View full analysis
int: try: # Confirmation is performed only when explicitly requested. if args.confirm: if not confirm_action("Reboot"): return 1 result = device_reboot( device_token=args.device_token, uuid=args.uuid, app_key=args.app_key, app_secret=args.app_secret, move_card=args.move_card, action="Reboot" ) return 0 except RuntimeError as e: print(f"Error: {e}", file=sys.stderr) return 1 def shutdown_action(args: argparse.Namespace) -> int: try: # Confirmation is performed only when explicitly requested. if args.confirm: if not confirm_action("Shutdown"): return 1 result = device_reboot( device_token=args.device_token, uuid=args.uuid, app_key=args.app_key, app_secret=args.app_secret, move_card=args.move_card, action="Shutdown" ) return 0 except RuntimeError as e: print(f"Error: {e}", file=sys.stderr) return 1 # Confirmation is opt-in rather than the default. parser.add_argument("--confirm", action="store_true", help="Request confirmation before the operation") ``` ### Technical Analysis Reboot and shutdown are availability-impacting operations. The implementation asks for confirmation only when the caller supplies `--confirm`. Without that flag, the operation is sent immediately. The documented normal-use commands omit `--confirm`, making the unsafe behavior the default. This design does not provide a reliable user-intent boundary when com ...[truncated 1910 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tainted flow: 'url' from os.getenv (line 55, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
93% confidence
Finding

The request target is derived from the JF_ENDPOINT environment variable and then used directly in requests.post while sending authentication material in headers, including uuid, appKey, timeMillis, and signature. If an attacker can influence the runtime environment, they can redirect this privileged device-control request to an attacker-controlled host, causing credential/signature leakage and unauthorized command relay.

Content

Scanner excerpt · scripts/device_reboot.py (reported line 65)May include surrounding context.

python
}
    }
    
    response = requests.post(url, headers=headers, json=body, timeout=30)
    result = response.json()
    
    if result.get("code") != 2000:

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的核心能力是远程重启或关闭设备,但实际代码块只是一个加密签名工具库,用于为杰峰 OpenAPI 请求生成签名。它不包含设备发现、设备控制、重启/关机指令发送、网络请求或任何与设备操作直接相关的逻辑。因此该代码的主要用途与声明的技能用途存在实质性不一致。尽管签名工具可能是设备控制技能的配套组件,但就这段代码本身而言,其实际行为并不体现所声明的“重启设备”功能。

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

md
| `SKILL.md` | 技能文档 |

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents use of environment variables and outbound API calls, but it does not declare any tool scope such as permissions or allowed-tools. That creates an authorization gap where a host agent may execute networked, credential-bearing actions without explicit capability disclosure or policy review. In a device-control skill, hidden env and network requirements materially increase the risk of unintended remote operations and secret misuse.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrases are broad and overlap with common user language, increasing the chance that the skill is invoked unintentionally. Because this skill can reboot or shut down devices, an accidental trigger can cause immediate service disruption, device downtime, and interruption of dependent operations.

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/device_reboot.py (reported line 65)May include surrounding context.

python
}
    }
    
    response = requests.post(url, headers=headers, json=body, timeout=30)
    result = response.json()
    
    if result.get("code") != 2000:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This skill performs destructive device operations such as reboot and shutdown without requiring an interactive confirmation by default because --confirm is optional. In automation or agent contexts, that makes accidental or unauthorized service interruption easier, especially since the script accepts credentials and target device identifiers non-interactively from environment variables.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

L003 的描述全文为中文,且整份技能文档均默认使用中文说明和触发词,没有声明仅面向特定语言用户,也未提供语言/locale 选择。根据该规则,若技能在自然语言层面隐含强制特定语言而无用户选择,属于语言/locale 政策风险。

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 natural-language documentation entirely in Chinese, including the module docstring and function descriptions. Under the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

Natural-language content in the docstring, CLI description, help text, prompts, and status messages is written only in Chinese. This forces a specific language experience without offering user opt-in or documenting that the tool is intentionally region- or locale-specific.

Content

No source excerpt is available for this finding.