Back to skill

Security audit

fangcloud_ai

Security checks for vulnerabilities and agentic risk

Overview

This skill has a real Fangcloud purpose, but it needs review before install because it runs unverified downloaded binaries, exposes broad admin actions, and ships hard-coded bearer tokens in documentation.

Install only after review by an administrator. The publisher should rotate/remove the exposed bearer tokens, provide signed or pinned release verification for binaries, publish or include auditable CLI source, separate admin APIs into an admin-only skill, and add explicit confirmations for public sharing, collection links, upload/download, delete, and tenant-wide actions. Use a least-privilege user token and avoid providing FANGCLOUD_ADMIN_TOKEN unless the admin operations are intentionally needed.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
cli/scripts/download_release_binary.sh:68
Finding
Remote Binary Is Downloaded and Executed Without Cryptographic Authenticity Verification<![CDATA[ ## Vulnerability Details **File Location**: `cli/scripts/download_release_binary.sh:8, 48-57, 68-91`; execution continues through `cli/scripts/run_release_binary.sh:43-59` **Vulnerability Type**: Unverified remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash BASE_URL="${BASE_URL:-https://app.fangcloud.com/sync/vv25/knowclaw/release}" ``` ```bash validate_binary() { local bin_path="$1" local os os="$(uname -s)" if [ "${os}" = "Darwin" ]; then # Avoid executing invalid Mach-O files that may be killed by the kernel. codesign --verify --verbose=2 "${bin_path}" >/dev/null 2>&1 else "${bin_path}" --help >/dev/null 2>&1 fi } ``` ```bash case "$(uname -s)" in Darwin|Linux) zip_name="${file}.zip" zip_url="${BASE_URL}/${zip_name}" tmp_zip="${RELEASE_DIR}/${zip_name}.tmp.$$" tmp_extract_dir="$(mktemp -d "${TMPDIR:-/tmp}/fangcloud-extract.XXXXXX")" trap 'rm -f "${tmp_zip}"; rm -rf "${tmp_extract_dir}"' EXIT echo "Downloading ${zip_url}" curl -fL "${zip_url}" -o "${tmp_zip}" extracted_bin="$(extract_binary_from_zip "${tmp_zip}" "${file}" "${tmp_extract_dir}")" if [ -z "${extracted_bin}" ] || [ ! -f "${extracted_bin}" ]; then echo "Downloaded zip does not contain expected binary: ${file}" >&2 exit 1 fi chmod +x "${extracted_bin}" if ! validate_binary "${extracted_bin}"; then echo "Downloaded binary is invalid and cannot run: ${zip_url}" >&2 echo "Please update the release artifact at the source URL." >&2 exit 1 fi mv -f "${tmp_zip}" "${RELEASE_DIR}/${zip_name}" cp "${extracted_bin}" "${bin_target}" chmod +x "${bin_target}" ``` The runner subsequently downloads and executes the binary: ```bash is_healthy() { local bin_path="$1" if [ "${os}" = "Darwin" ]; then codesign --verify --verbose=2 "${bin_path}" >/dev/null 2>&1 else "${bin_path}" --help >/dev/null 2>&1 fi } if [ ! -x "${target}" ] | ...[truncated 2981 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Publish a signed release manifest containing the filename, platform, architecture, version, and SHA-256 digest of every artifact. 2. Bundle the trusted public verification key with the Skill and verify the manifest with a mechanism such as Sigstore, minisign, or an equivalent release-signing system. 3. Verify the downloaded archive and extracted binary before setting executable permissions or invoking the binary for any reason. 4. Pin expected artifact hashes or immutable release versions in the reviewed Skill package. Do not rely only on a mutable URL. 5. Remove the production `BASE_URL` override, or enforce an explicit allowlist requiring the exact HTTPS scheme, hostname, port, and path prefix. 6. On macOS, require a designated code-signing identity or expected Apple Team ID and verify notarization rather than accepting any structurally valid signature. 7. On Linux, replace the executable `--help` health check with non-executing format and architecture checks performed only after signature and digest verification. 8. Validate ZIP entries and reject symlinks, unexpected paths, duplicate expected filenames, and archives containing multiple matching binaries. 9. Publish the CLI source and reproducible build instructions so the effective executable can be reviewed and independently reproduced. 10. Execute the CLI with a minimized environment and only provide the specific credential required for the requested operation. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
references/openapi.md:332
Finding
Bearer Credentials Are Hard-Coded in Distributed API Documentation<![CDATA[ ## Vulnerability Details **File Location**: `references/openapi.md:332-357, 387, 416-436, 456-659, 680-816, 851-1191, 1347, 1548, 1575, 1900` **Vulnerability Type**: Hard-coded bearer credentials **Risk Level**: High ### Vulnerable Code The API reference includes UUID-shaped bearer values directly in executable curl examples. Representative complete examples include: ```bash curl --location --request POST 'https://open.fangcloud.com/api/v2/file/75003907526/copy' \ --header 'Authorization: Bearer 583fad43-3265-45df-9e13-91fa5a22a2ca' \ --header 'Content-Type: application/json' \ --data '{ "target_folder_id": 75000441887 }' ``` ```bash curl --location --request GET 'https://open.fangcloud.com/api/v2/file/75003903551/download?version=0&valid_period=100' \ --header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0' ``` ```bash curl --location --request POST 'https://open.fangcloud.com/api/v2/file/create_blank_file' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer a2a192ea-cb37-4c0c-b8d5-574232fa853b' \ --header 'Cookie: lang=zh-CN' \ --data-raw '{ "departmentId":0, "name":"111", "parentEnterpriseId":21791, "nameConflictResolveStrategy":"2", "parentFolderId":0, "type":"1" }' ``` The audit identified 43 occurrences of UUID-shaped bearer values, including the following distinct examples: ```text 583fad43-3265-45df-9e13-91fa5a22a2ca a2a192ea-cb37-4c0c-b8d5-574232fa853b bdd88b1c-aa8a-4126-b380-a1e64f9348a5 775eb65c-8545-419d-823c-ffb5d42d75c0 bc326c4a-6eb0-4790-8cf3-3d19232af711 d8ec3bc7-c7f2-40b6-a591-7b03c134478f 1cd9081c-aa2c-4f30-a619-f32663dc57cc 003504d9-9a1e-4fc5-8b3e-188ee866b557 de74b292-3dbf-446a-9d30-c0e89106a682 cb806f3c-8d68-49ab-9925-4eefe3c8ec96 ``` ### Technical Analysis Bearer tokens are possession-based credentials: any party holding a valid token can generally exercise the permissions associated with it. Embedding realistic credential values in documentation distributes those valu ...[truncated 2045 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Immediately revoke and rotate every bearer value present in the document, regardless of whether it is believed to be a test credential. 2. Replace every hard-coded value with an unmistakable placeholder such as `${FANGCLOUD_USER_TOKEN}` or `<TOKEN>`. 3. Remove the credentials from repository history, release archives, documentation exports, package caches, and other retained distribution channels where feasible. 4. Review Fangcloud audit logs for use of the exposed tokens, especially from unexpected IP addresses or after the first publication date. 5. Use short-lived, narrowly scoped credentials for development and documentation testing. 6. Keep all credentials in an approved secret manager or protected environment variables rather than source-controlled files. 7. Add automated secret scanning to pre-commit hooks and CI, including patterns for UUID-shaped bearer credentials. 8. Add a release gate that rejects artifacts containing literal `Authorization: Bearer` values unless the value is an approved placeholder. 9. Document credential rotation, incident response, and least-privilege requirements for both user and administrator tokens. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (117)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The Chinese documentation likewise expands from Fangcloud integration into host inspection, binary validation, remote binary download, and execution of arbitrary subcommands through a local CLI. In context, this makes the skill more dangerous because it normalizes broad local execution under the guise of routine cloud operations.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The Chinese documentation likewise expands from Fangcloud integration into host inspection, binary validation, remote binary download, and execution of arbitrary subcommands through a local CLI. In context, this makes the skill more dangerous because it normalizes broad local execution under the guise of routine cloud operations.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The Chinese documentation likewise expands from Fangcloud integration into host inspection, binary validation, remote binary download, and execution of arbitrary subcommands through a local CLI. In context, this makes the skill more dangerous because it normalizes broad local execution under the guise of routine cloud operations.

Ae1

High
Category
analysis-evasion
Content
- macOS / Linux: `./cli/scripts/download_release_binary.sh`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- macOS / Linux: `./cli/scripts/download_release_binary.sh`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- macOS / Linux: `./cli/scripts/download_release_binary.sh`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
详细接口定义请参考 [references/openapi.md](references/openapi.md)。
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Missing User Warnings

High
Confidence
97% confidence
Finding
The workflow for creating share links omits an explicit warning that the resulting link may expose files outside the organization. In this context, public sharing is a sensitive operation because a single click can broaden access to confidential documents far beyond the normal cloud collaboration boundary.

Missing User Warnings

High
Confidence
98% confidence
Finding
Creating a public collection task effectively produces an internet-accessible upload endpoint, yet the workflow provides no warning about external submission, abuse, or inadvertent intake of malicious or sensitive content. That is particularly risky in a collaboration/file-storage skill because it can open an uncontrolled ingress path into organizational storage.

Credential Access

High
Category
Privilege Escalation
Content
rm -f "${archive_path}"
  ditto -c -k --keepParent "${binary_path}" "${archive_path}"
  xcrun notarytool submit "${archive_path}" \
    --keychain-profile "${MACOS_NOTARY_PROFILE}" \
    --wait
  echo "${archive_path}"
}
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Chaining Abuse

High
Category
Tool Misuse
Content
zip_url="${BASE_URL}/${zip_name}"
    tmp_zip="${RELEASE_DIR}/${zip_name}.tmp.$$"
    tmp_extract_dir="$(mktemp -d "${TMPDIR:-/tmp}/fangcloud-extract.XXXXXX")"
    trap 'rm -f "${tmp_zip}"; rm -rf "${tmp_extract_dir}"' EXIT

    echo "Downloading ${zip_url}"
    curl -fL "${zip_url}" -o "${tmp_zip}"
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
---

## 删除审阅评论
**Endpoint**: `DELETE /v2/review_comment/delete/{id}`

**Description**:
**需要使用用户token,根据用户id生成,详情参考上面生成的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).

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
The documented API surface includes large sets of tenant-administration, identity, audit, and synchronization endpoints that exceed the skill’s stated purpose of file management, collaboration, knowledge-base chat, and agent interaction. This kind of scope expansion materially increases blast radius if the skill is exposed to prompt injection, confused-deputy behavior, or misbinding of tokens, because the agent may gain pathways to perform privileged actions unrelated to user intent.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
Enterprise administration endpoints allow department, group, user, and platform synchronization actions using enterprise tokens, which are far more privileged than the end-user workflow described in the skill metadata. In an agent context, exposing these operations creates a severe confused-deputy risk where a prompt or misrouted request could trigger tenant-wide administrative changes.

Missing User Warnings

High
Confidence
94% confidence
Finding
Admin operations with tenant-wide effects are documented as routine examples without warnings about organizational impact, approval requirements, or token segregation. In an agent-integrated environment, that framing makes it easier for dangerous administrative actions to be invoked as if they were ordinary end-user tasks.

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
Login delegation and login-link generation endpoints can enable account access flows outside the stated file/knowledge workflow. When exposed through an agent, these endpoints can be abused for impersonation, session bootstrapping, or unauthorized sign-in handoff if prompts or tool-routing are compromised.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill clearly instructs use of shell/PowerShell and execution of platform-specific binaries, but it declares no tool scope or permissions boundary. That mismatch increases the chance an agent may invoke shell capabilities implicitly and perform sensitive local actions without explicit governance or user understanding.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The documentation tells users/agents to inspect the host environment and select/download executables based on OS and CPU architecture, which goes beyond the expected scope of a cloud-file skill. This increases attack surface by introducing host reconnaissance and local execution pathways that are not clearly justified by the declared purpose.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The skill embeds ready-to-run shell and PowerShell commands that download binaries from remote URLs. Even if the domain is legitimate, instructing automated download and later execution of remote artifacts creates a classic supply-chain and remote-code-execution risk, especially without strong integrity guarantees shown here.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill describes downloading cloud files to local storage and uploading local files to Fangcloud without explicit warning that data will cross trust boundaries and affect the local filesystem. In a file-management context this is plausible behavior, but absent disclosure and confirmation it can still cause unintentional data exposure, overwrite, or transfer of sensitive files.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The README documents the use of `FANGCLOUD_USER_TOKEN` and `FANGCLOUD_ADMIN_TOKEN` but does not warn that these are sensitive credentials or provide guidance on safe handling. In practice, users may paste tokens into shell history, commit them to source control, expose them in logs, or use high-privilege admin tokens unnecessarily, increasing the chance of credential theft and account or administrative compromise.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
This shell script automatically invokes another script to download a binary if the expected executable is missing or unhealthy, and then immediately executes that binary. There is no confirmation prompt, user-facing disclosure, or explanatory comment warning that the script may fetch and run code on the user's system.

External Transmission

Medium
Category
Data Exfiltration
Content
| `accessible_by` | `body` | `object` | 邀请对象 |
| `folder_id` | `body` | `int64` | 协作文件夹id |

**Curl Command**:
```bash
curl --location --request POST 'https://open.fangcloud.com/api/v2/collab/invite' \
--header 'Authorization: Bearer <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.

External Transmission

Medium
Category
Data Exfiltration
Content
| `accessible_by` | `body` | `array<object>` | 邀请对象 |
| `folder_id` | `body` | `int64` | 协作文件夹id |

**Curl Command**:
```bash
curl --location --request POST 'https://open.fangcloud.com/api/v2/collab/invite_batch' \
--header 'Authorization: Bearer <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.

External Transmission

Medium
Category
Data Exfiltration
Content
| `collab_ids` | `body` | `array<int64>` | 需要被删除的协作用户(支持批量) |
| `folder_id` | `body` | `int64` | 协作文件夹id |

**Curl Command**:
```bash
curl --location --request POST 'https://open.fangcloud.com/api/v2/collab/remove' \
--header 'Authorization: Bearer <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.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/openapi.md:332