T09 · Insecure Skill Coding Practices
- Location
scripts/share_url.py:97- Finding
Public tunnel exposes the entire parent directory of the selected report
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is coherent for Maibei audit automation, but its sharing path can publicly expose more local files than intended and handles live credentials in under-scoped ways.
Review carefully before installing. Use only test or least-privilege MaybeAI credentials, avoid passing live bearer tokens in shell history, and do not use --share from a workspace or folder containing anything sensitive. Treat trycloudflare links as public, unauthenticated URLs and stop the tunnel when finished.
scripts/share_url.py:97Public tunnel exposes the entire parent directory of the selected report
scripts/upload_audit.py:289Bearer token is required as a command-line argument
scripts/html_report.py:114Generated HTML embeds unvalidated URLs into clickable links
审核时间:{now} | 工作表:{escape(sheet_url)}
``` ```python # scripts/html_report.py:245-247The skill explicitly automates publishing the generated audit report through a public trycloudflare URL, but it does not require an explicit user confirmation or warn that the report may contain sensitive audit data, media URLs, spreadsheet links, or compliance findings. Because the skill is designed to process uploaded business media and return shareable links, accidental public exposure is a realistic outcome rather than a purely theoretical risk.
This script turns a local file or directory into a publicly accessible internet endpoint via trycloudflare and prints the URL, but it provides no user-facing warning, confirmation, access control, or scope restriction. In an agent skill context, that makes accidental exfiltration of sensitive local data much more dangerous because an automation flow could expose files or entire directories without the operator fully realizing they are becoming public.
The document explicitly states that validation was performed with real user tokens and real production workflow executions, and it provides operational details for reproducing those actions. Even though no raw token value is shown, this normalizes unsafe handling of production credentials and data, increasing the chance that operators reuse sensitive tokens in testing, expose them in logs, or run destructive actions against live systems.
The notes describe workflows that write to and append rows in live spreadsheets without warning that these operations mutate user-controlled data. In a skill context, this can mislead operators into executing state-changing actions on production artifacts, causing unauthorized modification, data corruption, or leakage into shared documents.
The notes provide concrete instructions for invoking authenticated workflow execution, including required bearer token and user-id headers, request structure, and workflow identifiers, without documenting a legitimate bounded purpose or safeguards. In practice, this materially lowers the barrier for replaying privileged backend actions and can enable unauthorized automation or abuse if the document is exposed to an agent or user who should not have this operational knowledge.
The document describes authenticated network requests carrying bearer tokens and user identifiers but provides no warnings, handling requirements, or restrictions around credential use. In an agent-skill context, that omission is dangerous because the notes are readily reusable as instructions for transmitting sensitive credentials to backend services.
Including a dedicated token-validation shortcut tells a reader exactly how to test whether captured credentials are usable, which is highly actionable for misuse. Even though the endpoint may be legitimate, documenting it here facilitates credential checking and operationalizes stolen or improperly obtained tokens.
The generated document explicitly sets lang="zh-CN", and the report text throughout the file is fixed in Chinese. This imposes a specific language/locale on all users without any opt-in, selection mechanism, or documented region-specific justification, which matches the policy-violation criteria.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
fi
# 1) Copy source sheet
curl 'https://play-be.omnimcp.ai/api/v1/workflow/run' \
-H 'accept: text/event-stream' \
-H "authorization: Bearer $TOKEN" \
-H 'content-type: application/json' \
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def start_http_server(directory, port):
"""Start a simple HTTP server in the background."""
cmd = [sys.executable, '-m', 'http.server', str(port)]
proc = subprocess.Popen(cmd, cwd=directory, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
return proc
def start_cloudflared(port):
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'--protocol', 'http2',
'--metrics', 'localhost:20241'
]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
return proc
def wait_for_url(proc, timeout=30):
The script trusts an upload URL returned by a remote service and blindly PUTs the local file to that URL. If the upstream service is compromised, misconfigured, or pointed at an attacker-controlled endpoint, sensitive local files selected for upload could be exfiltrated to an unintended destination.
content_type = mimetypes.guess_type(str(path))[0] or "application/octet-stream"
with path.open("rb") as fh:
put = requests.put(
upload_url,
data=fh,
headers={"Content-Type": content_type},
This code creates a public internet-accessible tunnel to locally served content with no authentication, expiration control, or access restriction implemented by the script. In the context of an audit tool that handles uploaded files and generated reports, that broad exposure can leak sensitive business data or internal analysis results to anyone possessing or discovering the URL.
The function claims to share a local file, but if given a directory it serves the entire directory over HTTP and then exposes it through a public Cloudflare tunnel. This mismatch increases the chance that a caller unintentionally publishes additional local files, including sensitive artifacts adjacent to the intended report.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
filename_hint = ""
port = find_free_port()
server_proc = subprocess.Popen(
[sys.executable, '-m', 'http.server', str(port)],
cwd=serve_dir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
)
time.sleep(1.5)
tunnel_proc = subprocess.Popen(
['cloudflared', 'tunnel', '--url', f'http://127.0.0.1:{port}',
'--no-autoupdate', '--protocol', 'http2'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
When --share is used, the script publishes the generated HTML report via a public tunnel but does not prominently warn that the report becomes internet-accessible. Users may assume this is a private sharing mechanism and unknowingly disclose report contents, uploaded file metadata, or sheet links.
The script requires --token and --user-id and uses them in authenticated HTTP requests to remote endpoints for upload and workflow execution. Although this is functionally necessary, the CLI provides no user-facing warning or description that these credentials and related file metadata will be sent to external services.
The script prints user-visible progress and success messages only in Chinese (正在分享到公网, 报告已发布). This imposes a specific language on users without opt-in or fallback, which violates the language/locale policy for natural-language content.