T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/start_server.py:17- Finding
Unauthenticated directory server listens on all network interfaces
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill does file sharing as advertised, but it can publicly expose files and open firewall ports by default without strong safeguards.
Install only if you are comfortable with a temporary unauthenticated public file server. Use it only on a tightly controlled directory containing non-sensitive files, prefer binding to 127.0.0.1 unless public access is explicitly needed, avoid automatic firewall opening, remove any firewall rules after use, stop daemon processes promptly, and do not use generated pages with untrusted filenames or descriptions.
scripts/start_server.py:17Unauthenticated directory server listens on all network interfaces
scripts/open_port.py:13Unrestricted firewall ACCEPT rules are inserted without lifecycle cleanup
scripts/generate_index.py:139Generated download page permits stored HTML and script injection
文件名:{filename}
大小:{file_size}
上传时间:{upload_time}
{args.description}
' if args.description else '' # 列出目录中的文件 file_items = [] for item in sorted(os.listdir(args.path)): item_path = os.path.join(args.path, item) if os.path.isfile(item_path) and not item.startswith('.') and item != 'index.html': size = get_file_size(item_path) file_items.append(f'''The skill claims it can start an HTTP download server, open firewall ports, and provide downloadable links, but the finding indicates the actual implementation does not perform those actions and may only generate static HTML. This mismatch is dangerous because users or downstream agents may rely on nonexistent protections or behaviors, causing accidental data exposure, broken workflows, or unsafe manual workarounds.
The skill is explicitly designed to expose local files over HTTP and open firewall ports, but the description does not foreground the privacy and external-network risks at the point of invocation. In this context, that omission is significant because users may unintentionally publish sensitive directories or make a host reachable from untrusted networks.
The skill documents shell commands and Python scripts that read files, write HTML output, and manipulate network exposure, but it declares no explicit tool scope or permissions boundary. In an agent setting, missing scope makes it easier for the skill to be invoked with broader-than-expected capabilities, increasing the chance of unsafe file access or shell execution.
The trigger phrases are broad enough to match common requests about downloading or sending files, which can cause the skill to activate in contexts where the user did not intend to expose files over HTTP. In this skill's context, unintended activation is more dangerous because the documented behavior includes network exposure and firewall changes.
The quickstart explicitly instructs users to bind an HTTP file server to 0.0.0.0 and open the firewall with iptables, which exposes files to any reachable host without authentication, encryption, or scope warnings. In the context of a file-sharing skill, this is functional behavior, but the lack of clear cautions about public exposure, sensitive files, and network reachability makes accidental data disclosure reasonably likely.
This code includes user-facing natural-language content that is fixed to Chinese, beginning with the module description and continuing throughout CLI help and generated HTML. The policy allows locale constraints only when they are opt-in or clearly justified, and this file does neither.
The generated HTML displays fixed Chinese UI text such as the service status label, and similar hard-coded Chinese strings appear elsewhere in the page template. Because the file does not offer localization or an explicit justification for a Chinese-only experience, this is a language-policy issue.
The docstring, CLI description, argument help, and user-facing output are written only in Chinese, which imposes a specific language on all users. The file does not offer any language selection or explain that the skill is intended only for a Chinese-speaking or region-specific context.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
success_count = 0
for port in args.ports:
try:
result = subprocess.run(
["iptables", "-I", "INPUT", "-p", "tcp", "--dport", str(port), "-j", "ACCEPT"],
capture_output=True,
text=True
This code presents its description, CLI help text, and user-facing messages exclusively in Chinese. Under the policy rule, forcing a specific language without offering user choice or documenting a justified locale restriction is a natural-language policy violation.
The skill goes beyond starting a temporary download server and modifies host firewall policy, which requires elevated privileges and changes the system's security posture. In this context, the danger is increased because the server also defaults to binding on 0.0.0.0, so opening the port can expose shared files to the entire reachable network or internet.
This subprocess call inserts an iptables rule opening the chosen TCP port on the host firewall. Although the command is passed as an argument list rather than a shell string, it still performs a privileged security-sensitive action that broadens network exposure and can unintentionally make the file server reachable from untrusted networks.
# 尝试开放防火墙端口
try:
result = subprocess.run(
["iptables", "-I", "INPUT", "-p", "tcp", "--dport", str(args.port), "-j", "ACCEPT"],
capture_output=True,
text=True
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if args.daemon:
print("\n🚀 后台启动服务器...")
# 后台运行
process = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print("\n🚀 前台启动服务器(按 Ctrl+C 停止)...")
print("")
try:
subprocess.run(cmd)
except KeyboardInterrupt:
print("\n\n👋 服务器已停止")
Natural-language content throughout the file forces a specific language locale for all users without offering an alternative or documenting that the skill is intentionally region- or language-specific. This can violate organizational language-choice policy when users are not given an opt-in or fallback.