Back to skill

Security audit

File Browser Operator

Security checks for vulnerabilities and agentic risk

Overview

The skill is a legitimate FileBrowser API helper, but its examples and bulk workflows can bypass the declared folder scope or move/delete files without enough guardrails.

Review before installing. Use a FileBrowser account restricted server-side to the intended directory, set a narrow scope, and do not follow the root-level curl examples as written. Require a preview and explicit approval before bulk organizing, sharing, overwriting, or deleting files, and avoid using an admin account unless user-management tasks are truly needed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:252
Finding
Operational Examples Bypass the Configured FileBrowser Scope## Vulnerability Details **File Location**: `SKILL.md`, lines 252–256 **Vulnerability Type**: Scope enforcement bypass in documented API commands **Risk Level**: Medium ### Vulnerable Code ```bash # List the root directory curl -s -H "X-Auth: $TOKEN" "$BASE/api/resources?path=/" # Upload echo "hello" | curl -s -X POST "$BASE/api/resources/hello.txt?override=true" \ -H "X-Auth: $TOKEN" -H "Content-Type: text/plain" --data-binary @- ``` ### Technical Analysis The Skill states that all FileBrowser operations must remain under the directory configured by `scope`. However, the operational examples violate that security boundary in two ways: 1. `GET /api/resources?path=/` enumerates the FileBrowser root rather than the configured scope. 2. `POST /api/resources/hello.txt` uploads a file directly to the root because the resource path lacks the required scope prefix. These examples are part of the Agent-facing instructions and may therefore be copied or followed during real operations. The restriction is only expressed as a textual rule; the examples do not normalize or validate paths before issuing requests. The authenticated FileBrowser account, rather than the Skill’s declared scope, consequently becomes the effective access boundary. ### Attack Path 1. A FileBrowser account with access beyond the configured scope is supplied to the Skill. 2. A user asks the Agent to list files or upload a resource using the documented curl workflow. 3. The Agent follows the examples and sends a request using `path=/` or `/api/resources/hello.txt`. 4. FileBrowser authorizes the request according to the account’s server-side privileges. 5. Root-level metadata is returned or a file is written outside the user-approved scope. No server vulnerability is required; exploitation relies on the discrepancy between the declared scope restriction and the documented commands. ### Impact Assessment An Agent following these examples may: - Enumerate names and metadata of resources ...[truncated 457 chars]
Remediation
## Remediation Suggestions 1. Replace the root-listing example with a request that uses the configured and validated scope: ```bash curl -sG -H "X-Auth: $TOKEN" \ --data-urlencode "path=$FB_SCOPE" \ "$BASE/api/resources" ``` 2. Prefix every upload, download, deletion, sharing, and directory-creation path with the validated scope: ```bash curl -s -X POST \ "$BASE/api/resources/${FB_SCOPE#/}/hello.txt?override=true" \ -H "X-Auth: $TOKEN" \ -H "Content-Type: text/plain" \ --data-binary @- ``` 3. Require `FB_SCOPE` or the equivalent configuration value to be present before any resource operation. Fail closed when it is absent or invalid. 4. Normalize paths before requests, reject `..`, encoded traversal sequences, absolute-path ambiguity, and any normalized path that is not equal to or beneath the configured scope. 5. Use one shared path-validation routine for listing, upload, download, deletion, movement, directory creation, and share creation. 6. Remove `override=true` from generic examples or require explicit user confirmation before overwriting an existing resource. 7. Configure the FileBrowser account itself with server-side permissions restricted to the same scope, ensuring that a documentation or validation mistake cannot access broader resources.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (13)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
- 可用 `curl -s -o /dev/null -w "%{http_code}" <baseUrl>/api/public/dl/<hash>` 验证链接是否可下载(应返回 200)。注意:不要用 HEAD(`curl -I`)验证,该端点不支持 HEAD 方法。

4. **删除分享**
   - `DELETE /api/share/<hash>`,Header `X-Auth: <token>`。

### 按订单类型整理(如「对采购单进行整理」)
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
- 可用 `curl -s -o /dev/null -w "%{http_code}" <baseUrl>/api/public/dl/<hash>` 验证链接是否可下载(应返回 200)。注意:不要用 HEAD(`curl -I`)验证,该端点不支持 HEAD 方法。

4. **删除分享**
   - `DELETE /api/share/<hash>`,Header `X-Auth: <token>`。

### 按订单类型整理(如「对采购单进行整理」)
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
4. **移动文件**
   - 目标路径为:`<类型>/<YYYY>/<MM>/<原文件名>`(如 `采购单/2026/03/采购单-xxx-20260312.xlsx`),须在 scope 内。
   - FileBrowser 无「移动到新路径」的单次 API,采用:**GET /api/raw/<原路径>** 下载内容 → **POST /api/resources/<目标路径>?override=true** 上传 → **DELETE /api/resources/<原路径>** 删除原文件。若目标已存在且用户未要求覆盖,可视为「目标已存在,未移动」,归入无法整理并说明原因。
   - 若下载、上传或删除任一步失败:该文件留在原位置,归入「无法整理」列表,原因写为「移动失败」并尽量附带接口返回信息(如权限不足、目标已存在等)。

5. **汇总并提示用户**
Confidence
81% confidence
Finding
The move workflow instructs deletion of the original file after download-and-reupload, but the procedure relies on path handling generated by the agent and lacks concrete guardrails for canonicalization, revalidation, and rollback. If path parsing or scope checks are wrong, this can delete unintended files or cause destructive partial moves where the original is removed after an incorrect or corrupted upload.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
### 删除

```http
DELETE /api/resources/<路径>
X-Auth: <token>
```
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
- **列出用户**:`GET /api/users`,Header 需带 `X-Auth`。
- **新建用户**:`POST /api/users`,Body 为 JSON,包含 `username`、`password`(至少 12 位)、`perm` 等。
- **更新用户**:`PATCH /api/users/<id>` 或按实际 API 约定。
- **删除用户**:`DELETE /api/users/<id>`。

具体字段以实际 Swagger/文档为准;部署内可访问 `http://<base>/swagger/` 查看(若已开启)。
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Credential Access

High
Category
Privilege Escalation
Content
凭证从环境变量读取,**勿在脚本中写明文密码**:

```bash
# 从 .env 或环境变量读取(FB_USER、FB_PASSWORD 勿提交到 Git)
BASE="${FB_BASE_URL:-http://127.0.0.1:9888}"
TOKEN=$(curl -s -X POST "$BASE/api/login" \
  -H "Content-Type: application/json" \
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
| DELETE | `/api/resources/<路径>` | 删除文件或目录 |
| PATCH | `/api/resources/<路径>` | 重命名等,Body 按实际 API 约定(通常不支持路径中含 `/` 的“移动到新路径”) |

**移动文件**(到新路径):无单次“移动”接口时,可用:`GET /api/raw/<原路径>` 下载 → `POST /api/resources/<新路径>?override=true` 上传 → `DELETE /api/resources/<原路径>` 删除。

路径均为相对 FileBrowser 根目录。**本 skill 仅允许在 config 中 `scope` 所指定的目录下操作**,所有 `path` 须落在 `scope` 之内。
Confidence
93% confidence
Finding
The documented move workflow performs a download, re-upload, and then deletion of the original path, which is a destructive sequence if path validation, destination validation, or operation ordering fails. Even though the document states operations must stay within configured scope, the skill exposes delete-capable primitives and a bulk organization flow, so mistakes, prompt injection via filenames/paths, or weak enforcement could lead to irreversible data loss or unauthorized modification within scope.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The skill's natural-language instructions, headings, and operational guidance are presented only in Chinese, which effectively forces a specific language for users. The file does not offer an opt-in language choice or explain that the skill is intentionally limited to a Chinese-speaking or region-specific context.

External Transmission

Medium
Category
Data Exfiltration
Content
3. **验证**
   - 创建后检查响应中的 `path` 是否与请求路径一致(如 `/Qianlu/采购单-RFQ0311.xlsx`)。若 `path` 异常(如 `"s"` 或与请求不符),说明使用了错误端点,须检查 URL 是否为 `/api/share/<路径>`(单数)。
   - 可用 `curl -s -o /dev/null -w "%{http_code}" <baseUrl>/api/public/dl/<hash>` 验证链接是否可下载(应返回 200)。注意:不要用 HEAD(`curl -I`)验证,该端点不支持 HEAD 方法。

4. **删除分享**
   - `DELETE /api/share/<hash>`,Header `X-Auth: <token>`。
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The example curl commands operate on root-level paths (`path=/`, `hello.txt`) even though the skill repeatedly states that all operations must remain under a configured `scope`. In a real deployment, users often copy examples verbatim, so these examples can cause accidental access to or modification of files outside the intended restricted directory.

External Transmission

Medium
Category
Data Exfiltration
Content
curl -s -H "X-Auth: $TOKEN" "$BASE/api/resources?path=/"

# 上传
echo "hello" | curl -s -X POST "$BASE/api/resources/hello.txt?override=true" \
  -H "X-Auth: $TOKEN" -H "Content-Type: text/plain" --data-binary @-

# 下载
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger condition for the file-organizing workflow is described only as a user saying something like 'organize purchase orders,' without requiring explicit confirmation of scope, preview of matches, or approval of the move plan. In a skill that can recursively search, upload, and delete files, this ambiguity can cause unintended bulk file movement based on loose natural-language matching, especially when filenames merely contain the target term.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The example values for username and password are written only in Chinese ("你的用户名", "你的密码至少12位"). This imposes a specific language on users in a natural-language field without opt-in or documentation that the skill is intended only for Chinese-speaking users.

Static analysis

Detected: suspicious.install_untrusted_source

Install source points to URL shortener or raw IP.

Warn
Code
suspicious.install_untrusted_source
Location
config.example.json:2