T09 · Insecure Skill Coding Practices
- Location
scripts/capture.py:30- Finding
Authenticated API Requests Can Be Redirected to an Arbitrary Host
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to perform the advertised camera capture task, but it handles camera credentials, API endpoints, and downloaded images with weak scoping that could expose tokens or write files unexpectedly.
Review before installing. Use only the listed JFTech API domains for JF_ENDPOINT, avoid passing real device passwords on the command line, treat captured images and URLs as sensitive, and avoid --download on shared or privileged machines until endpoint, URL, size, and filename validation are improved.
scripts/capture.py:30Authenticated API Requests Can Be Redirected to an Arbitrary Host
scripts/capture.py:120Unvalidated Image URL Enables Server-Side Request Forgery and Unbounded Downloads
scripts/capture.py:390Unsanitized Device Serial Number Can Escape the Capture Output Directory
scripts/capture.py:471Capture Workflow Requires and Collects an Unused Device Password
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"accessToken": access_token
}
response = requests.post(url, headers=headers, json=body, timeout=30)
result = response.json()
if result.get("code") != 2000:
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"accessToken": access_token
}
response = requests.post(url, headers=headers, json=body, timeout=30)
result = response.json()
if result.get("code") != 2000:
声明描述的核心能力是设备抓图相关业务功能,但代码块实际仅是底层加密辅助模块,负责生成时间戳和请求签名。虽然这种签名工具可能是抓图 API 调用的支持性实现细节,但就当前提供的代码块本身而言,其主要行为与声明的主要用途明显不一致。根据评估标准,这属于“实际主要目的与声明不同”,应判定为描述与行为不匹配。
Referenced artifact was not completely inspected
| `SKILL.md` | 技能文档 |
The skill documentation declares network, environment-variable, and file-based behavior but does not define any explicit tool scope or allowed-tools boundary. In agent environments, this can lead to overbroad execution privileges, making it easier for the skill to access secrets, read local files, or perform network calls beyond the user's expectation.
The documentation promotes optional local download of captured device images without warning that these images may contain sensitive surveillance content and will persist on disk. In the context of camera capture, silent local storage increases privacy, retention, and unauthorized-access risk, especially on shared hosts or poorly secured workspaces.
The documentation instructs users to provide sensitive secrets including app secrets, device passwords, and access tokens, but does not clearly warn against logging, hardcoding, or exposing them in shell history and shared environments. Because this skill interfaces with device capture APIs, leaked credentials could enable unauthorized image capture, token abuse, or broader account compromise.
This code file contains user-facing natural-language text entirely in Chinese, including the module description and later CLI output/help strings, with no indication that other languages are supported. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"accessToken": access_token
}
response = requests.post(url, headers=headers, json=body, timeout=30)
result = response.json()
if result.get("code") != 2000:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"accessToken": access_token
}
response = requests.post(url, headers=headers, json=body, timeout=30)
result = response.json()
if result.get("code") != 2000:
The code downloads from image_url returned by a remote API without validating the destination host, scheme, or content type. If the upstream service is compromised or spoofed, this can turn the skill into an SSRF-style fetcher or cause it to retrieve unexpected internal or malicious content and write it to disk.
是否成功
"""
try:
resp = requests.get(image_url, timeout=30)
if resp.status_code == 200:
with open(output_path, 'wb') as f:
f.write(resp.content)
L518-L519 的校验提示明确声明 capture-auto 需要设备密码,暗示该操作会使用用户名/密码参与认证或抓图流程。但在 L231-L313 的 capture_auto_action 以及其调用链中,代码只通过开放平台凭证获取 token 并抓图,未读取或使用 args.password。这属于文案/参数说明与实际行为相矛盾,而非单纯信息不完整。
This code file contains user-facing natural-language documentation exclusively in Chinese, including the module docstring and function comments. Under the stated policy, forcing a specific language without offering the user a language/locale choice can be a natural-language policy violation.
The script prints a user-facing message only in Chinese at runtime, with no option to choose another language or indication that the tool is region-specific. This can violate language/locale policy because the skill effectively forces one language on all users.
The inline test block sets move_card = "your-movecard-here" and immediately passes it to generate_signature, while the function signature declares move_card: int and change() uses i % move_card. This is an active contradiction between the example/documentation intent and what the code can actually execute.