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.
