T09 · Insecure Skill Coding Practices
- Location
scripts/jf_open_pro_capture_livestream.py:57- Finding
Unrestricted API Endpoint Allows Sensitive Information to Be Redirected
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a real JF camera/device API helper, but it handles private device credentials and media links with weak endpoint scoping and log exposure risks.
Review this skill before installing in any agent or shared logging environment. Only run it with JF_ENDPOINT unset or set to a trusted official JF API host, treat printed tokens/session IDs/snapshot URLs/livestream URLs as credentials, and avoid running capture or livestream commands unless you intend to expose that device media to the current session output.
scripts/jf_open_pro_capture_livestream.py:57Unrestricted API Endpoint Allows Sensitive Information to Be Redirected
scripts/jf_open_pro_capture_livestream.py:384Device Tokens, Session IDs, and Private Media URLs Are Printed to Standard Output
scripts/requirements.txt:3Dependency Version Is Not Reproducibly Pinned
代码核心功能与声明大体相关,确实涉及设备状态查询、登录、抓图和直播地址获取,因此不是完全无关。但声明中的关键卖点是“批量获取”“多设备多通道抓图”,而代码实际仅支持单个设备 SN,并且 capture/livestream 在主程序里固定对单一通道执行一次,没有批量循环、设备列表输入或多通道处理逻辑。这属于对主要能力的夸大,描述未准确反映实际行为,因此应判定为不匹配。
The skill advertises credential and endpoint usage and includes example shell and Python execution paths, but it does not declare an explicit tool/permission scope such as allowed network, environment-variable, or shell capabilities. In agent environments, missing scope declarations can cause over-broad execution privileges or make reviewers unable to enforce least privilege, increasing the chance of unintended command execution or secret access.
Overly broad trigger phrases can cause the skill to activate in situations the user did not intend, especially for common actions like checking device state or querying devices. Because this skill can access credentials and make external network calls to retrieve device status, snapshots, or livestream URLs, accidental invocation can disclose sensitive device metadata or initiate billable operations.
The script sends device identifiers, authentication material, and potentially device usernames/passwords to a remote endpoint, and the destination host is configurable through the JF_ENDPOINT environment variable without validation or allowlisting. In a skill/agent context, a manipulated environment or configuration could redirect sensitive requests to an attacker-controlled server, causing credential and device-access token exfiltration.
headers['Content-Type'] = 'application/json'
try:
response = requests.post(url, headers=headers, json=body, timeout=30)
return response.json()
except Exception as e:
return {'code': 0, 'msg': str(e)}
The entire skill documentation is written in Chinese and does not indicate that other languages are supported or that Chinese is a deliberate, region-specific requirement. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.
L051 的自然语言注释“仅支持 Python”表达了对语言的硬性限制,但文件中未说明这是用户自选、平台约束,或为何必须限制为该语言。根据策略,若强制特定语言而未提供选择或明确合理说明,属于自然语言层面的政策问题。
This code file contains natural-language documentation and CLI output that force a single language/locale for all users. Under the policy rule, a fixed language is only acceptable when the tool offers user choice or clearly documents a justified regional constraint, which is not present here.
The module docstring says '仅支持环境变量' and '不支持命令行参数或配置文件', which broadly states that command-line parameters are unsupported. However, main() reads sys.argv[1] to control behavior such as status, login, capture, livestream, and token. This is a documentation/code contradiction, even though the command-line input is limited to operation selection rather than credentials.
The comment JLink Python SDK 依赖 is written only in Chinese, which indicates a language-specific instruction/comment without offering a language choice or documenting a justified locale constraint. This can violate language/locale policy when the skill is expected to be generally usable without forcing a specific language.
The dependency is specified as requests>=2.28.0, which allows installation of any later version without reproducibility guarantees. This can introduce vulnerable, incompatible, or unexpected releases during deployment, making supply-chain risk and patch verification harder; in a skill that captures livestreams from devices over network APIs, HTTP client behavior is security-relevant.
# JLink Python SDK 依赖
requests>=2.28.0
The manifest uses requests without pinning to a known-safe version, and the package has multiple historical advisories. Because the installed version is not fixed, you cannot verify whether deployments will avoid affected releases, which is a real supply-chain uncertainty; in a device API/livestream capture skill, flaws in HTTP handling could expose credentials, session state, or device data.