T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/annotation-api.py:24- Finding
Unrestricted Filesystem Enumeration and JSONL File Disclosure
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real data-annotation skill, but its web API and deployment instructions create broad unauthenticated file access and host-configuration risks.
Install only after review. Use it in a contained environment, keep datasets non-sensitive unless you have approved the model provider, avoid the provided Nginx/root deployment flow, do not expose the API publicly, and restrict all reads and writes to a dedicated annotation results directory.
scripts/annotation-api.py:24Unrestricted Filesystem Enumeration and JSONL File Disclosure
scripts/annotation-api.py:76Unauthenticated Arbitrary File Creation and Overwrite
scripts/annotation-api.py:103Externally Exposed Annotation API Has No Authentication and Allows Cross-Origin Requests
scripts/annotation-api.py:43Directory Containment Check Can Be Bypassed by Shared Path Prefixes
templates/annotation-viewer.html:194DOM-Based Cross-Site Scripting Through Unescaped Filenames and Paths
SKILL.md:217Deployment Instructions Require Excessive Root-Level Privileges
SKILL.md:46Unpinned Runtime Installation of Third-Party Dependencies
The documented behavior extends beyond a normal annotation assistant into deployment, process management, and potentially arbitrary file writes via the referenced POST save flow. When a skill's real behavior exceeds its stated purpose, users and orchestrators may authorize it under false assumptions, creating a privilege and trust mismatch that can be abused.
The skill instructs sending image/text data to external model APIs without an explicit disclosure or consent step. Annotation datasets commonly contain proprietary, personal, or regulated content, so silent third-party transmission can create confidentiality, compliance, and contractual violations.
The skill instructs modifying global nginx configuration and restarting the web server, which affects the entire host rather than just annotation data. Such system-wide changes can break unrelated services, expose files over HTTP, or be repurposed to alter routing/security boundaries on the machine.
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
systemctl restart nginx
curl -s -o /dev/null -w "%{http_code}" http://localhost/annotation/<项目名>/results/viewer.html # 期望 200 curl -s -o /dev/null -w "%{http_code}" http://localhost/annotation/<项目名>/<视频文件>.mp4 # 期望 200 curl -s "http://localhost/annotation-api/" | python3 -c "import sys,json;print(len(json.load(sys.stdin).get('files',[])))" # 文件数>0
The POST save endpoint accepts a client-supplied file path and writes to it directly, creating parent directories as needed and truncating the destination with open(..., 'w'). This allows a caller to overwrite arbitrary files writable by the service account, which exceeds the stated annotation-saving scope and can corrupt application data, configs, or other local files.
The skill clearly directs file reads/writes and network access, but it declares no explicit tool scope or permissions boundaries. In an agent environment, this increases the chance the skill is invoked with broader capabilities than users expect, enabling unintended data access or transmission during annotation workflows.
The trigger phrases are very broad and overlap with common requests like '数据处理' or 'label', increasing the risk that the skill activates in contexts where users did not intend annotation or data export behavior. In an agent system, over-triggering can lead to unnecessary file access, web deployment steps, or external model calls on sensitive content.
The manifest covers data annotation and web-based viewing/editing, but the instructions direct installing packages with pip and apt, invoking pandoc, ffmpeg, fuser, and running background services with nohup. While some document/media processing is related, system package management and service orchestration are not clearly within the declared annotation-tool scope.
The instruction to restate requirement documents, schemas, and label lists back to the user/agent can unnecessarily replicate sensitive business rules or embedded confidential data. In multi-agent or logged environments, echoing such content increases exposure without being essential to safe processing.
This is a direct external transmission path to a third-party API, carrying image content and prompt text that may include sensitive annotation material. In the context of a data annotation skill, this is especially dangerous because datasets often contain confidential customer data, personal information, or unreleased media.
# 使用阿里百炼 qwen3.5-plus 分析图片
curl -s https://coding.dashscope.aliyuncs.com/v1/chat/completions \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
The deployment flow kills processes, restarts nginx, changes permissions, and launches a background service without an explicit warning or approval checkpoint. These actions modify system state and service availability, so performing them as part of a routine annotation skill creates avoidable operational and security risk.
Changing /root permissions to 755 weakens a core host security boundary by making the root home traversable to other users/processes, solely to facilitate web serving. This broadens exposure of root-owned paths and signals an unsafe pattern of relaxing system protections instead of using properly permissioned deployment directories.
mkdir -p /root/annotation-data/
ln -sf <实际数据目录> /root/annotation-data/<项目名>
chmod 755 /root # 关键!否则 nginx 无法访问
Launching the API with nohup in the background creates persistent state beyond the current session and can leave a data-writing service running indefinitely without lifecycle management. If the service is insecure or misconfigured, it expands the attack surface and may continue exposing or modifying annotation data after the task ends.
fuser -k 8888/tcp 2>/dev/null
nohup python3 <skill路径>/scripts/annotation-api.py --port 8888 --data-dir <数据目录> > <数据目录>/results/api.log 2>&1 &
This markdown file presents all instructions and examples exclusively in Chinese, which can violate a language/locale policy when users are not given an opt-in or alternative language. The file does not indicate that the skill is intentionally region-specific or that Chinese is a documented requirement.
The code only enforces DATA_DIR containment for /file, but / accepts arbitrary dir and results parameters and uses them to recursively list files and load annotation data from any readable path. That exposes filesystem structure and contents beyond the intended dataset area, undermining the claimed restriction and enabling local information disclosure.
The save operation opens the target file in write mode unconditionally, so any existing file at the chosen path is silently replaced. Combined with the unvalidated client-controlled path, this creates a destructive arbitrary file overwrite primitive rather than a normal annotation export feature.
The description defines usage in expansive, ambiguous terms like data processing, dataset generation, and annotation viewing/editing without clear boundaries. This increases the chance the agent routes unrelated requests into a capability that may inspect or transform user content, creating authorization, privacy, and least-privilege concerns.
The trigger is purely keyword-based and very broad, so ordinary conversations about datasets, labels, or data processing could invoke the skill unintentionally. Because this skill can process user data and launch annotation workflows or a web interface, accidental activation can lead to unnecessary data handling, privacy exposure, or confusing tool execution beyond user intent.
The document declares lang="zh-CN", and the visible UI text throughout the page is exclusively in Simplified Chinese. This imposes a specific language/locale on all users without any opt-in, selection mechanism, or documented region-specific justification.
The changelog contains a natural-language instruction, "所有日期格式为 YYYY-MM-DD。", and the surrounding headings/content are in Chinese, which indicates a locale/language constraint. Under the stated policy, forcing a specific language or locale without opt-in or justification is a reportable natural-language policy issue.
The module docstring and runtime messages are written only in Chinese, which imposes a language choice on users without opt-in or alternatives. The policy explicitly calls out language or locale constraints as violations when they are forced rather than optional or justified.
The manifest's user-facing natural-language description and trigger guidance are entirely in Chinese, which may impose a language expectation without explicit user opt-in or a documented region-specific constraint. Under the stated policy, language-specific behavior should either be optional for users or clearly justified.