Back to skill

Security audit

Feishu Doc Transfer

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but it can immediately transfer Feishu document ownership using a tenant token and gives too little protection against mistakes or token exposure.

Install only if you are comfortable with a tool that can reassign Feishu document ownership. Use a least-privilege Feishu app, avoid putting real tenant tokens in command history or shared transcripts, verify the file token and target owner carefully, and prefer adding a confirmation or dry-run workflow before operational use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:15
Finding
Tenant Bearer Token Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 15-20; implemented by `scripts/transfer_owner.py` through `sys.argv` **Vulnerability Type**: Sensitive credential exposure through process arguments **Risk Level**: Medium ```bash python3 ~/.qclaw/skills/feishu-doc-transfer/scripts/transfer_owner.py \ <tenant_token> \ <file_token> \ <owner_id> \ <member_type> \ [file_type] ``` The script retrieves the credential directly from its command-line arguments: ```python tenant_token = sys.argv[1] file_token = sys.argv[2] owner_id = sys.argv[3] member_type = sys.argv[4] file_type = sys.argv[5] if len(sys.argv) > 5 else "doc" ``` ### Technical Analysis The Skill instructs users and agents to place a Feishu tenant access token directly in a command string. The script then reads that bearer token from `sys.argv`. Command-line arguments are not an appropriate secret-delivery mechanism. Depending on the operating environment, the token can be exposed through: - Shell history files. - Agent command transcripts and execution logs. - Process monitoring and telemetry. - Process argument inspection by sufficiently privileged local users. - Debugging, audit, or job-scheduling systems that record full commands. The token is legitimately transmitted over HTTPS to the official Feishu endpoint in the `Authorization` header. That network transmission is necessary for the declared ownership-transfer functionality and no unrelated network destination was identified. The vulnerability is the local handling of the token before transmission, not the Feishu API request itself. ### Attack Path 1. A user or agent follows the documented invocation and places a valid tenant token in the command line. 2. The complete command is retained in shell history, agent logs, telemetry, or process metadata. 3. An attacker with access to one of those sources extracts the bearer token. 4. Before the token expires, the attacker submits authenticated requests to Feishu ...[truncated 871 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not accept the tenant token as a positional command-line argument. - Read the token from protected standard input using a non-echoing prompt, a permission-restricted secret file, an environment supplied by an approved secret manager, or a platform-native credential store. - Prefer a `--token-stdin` or `--token-file` interface and document secure invocation examples. - Ensure secret files are readable only by the intended account and are deleted securely when no longer required. - Configure OpenClaw, shell, telemetry, and job-execution logs to redact authorization credentials. - Avoid including real tokens in command examples, error messages, exception details, or returned JSON. - Grant the Feishu application only the narrowest available permissions and rotate any token suspected of appearing in logs or command history. ]]>

T08 · Insecure Dependencies

Note
Location
SKILL.md:69
Finding
Third-Party Dependency Installed Without Version or Integrity Pinning<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 69-71 **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Low ```markdown ## Dependencies - Python 3.6+ - requests library (`pip install requests`) ``` ### Technical Analysis The installation guidance resolves the latest available `requests` package and its transitive dependencies at installation time. It does not specify a reviewed version, lock transitive dependencies, verify cryptographic hashes, or identify a controlled package index. No typosquatting, dependency-confusion package name, malicious package, or currently compromised dependency was identified. The risk arises from mutable and unreproducible dependency resolution: a future compromised, substituted, or incompatible release could be installed without a corresponding review of this Skill. ### Attack Path 1. A user follows the documented `pip install requests` instruction. 2. The package resolver contacts its configured package index and selects versions available at that time. 3. If the index, account, package release, resolver configuration, or a transitive dependency has been compromised, the environment installs attacker-controlled content. 4. Malicious package installation or import-time behavior executes with the privileges of the user running the Skill. This is a supply-chain hardening issue. The audited project does not contain evidence that the current `requests` package is malicious. ### Impact Assessment If dependency resolution is compromised, attacker-controlled Python code could execute with the installing or invoking user's privileges. That code could access data and credentials available to the process, including a tenant token supplied to the script. Practical exploitation depends on an external package-index or dependency compromise, unsafe resolver configuration, or installation from an untrusted source. The absence of a lock file and hashes increases exposure but does not by itsel ...[truncated 36 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Add a reviewed dependency manifest with an exact `requests` version and pinned transitive dependencies. - Generate and verify cryptographic hashes, for example through a hash-locked requirements file and `pip install --require-hashes`. - Use a trusted package index or an organization-controlled mirror. - Review and update pinned dependencies on a defined schedule so security patches are not indefinitely blocked. - Run dependency vulnerability and provenance checks in continuous integration. - Install dependencies in an isolated virtual environment under a non-privileged account. - Document the supported Python version range and test the locked dependency set against those versions. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill invokes a Python script that performs API calls to Feishu and therefore has network-capable behavior, but the manifest does not declare any tool scope such as permissions or allowed-tools. This weakens policy enforcement and user visibility, making it easier for a skill that changes document ownership to operate without explicit capability disclosure.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill performs ownership transfer of documents, which is a privileged and potentially disruptive action affecting control, access, and accountability, yet the description lacks a clear warning about sensitivity or possible irreversibility. In this context, a user may trigger the operation without fully understanding that it can reassign control of important enterprise content.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The instructions tell users to obtain and use tenant tokens and app credentials but do not clearly warn that these are sensitive secrets that must not be exposed in command history, logs, chat transcripts, or shared examples. Because these credentials can authorize document-management actions across a tenant, mishandling them could enable unauthorized ownership changes or broader API misuse.

External Transmission

Medium
Category
Data Exfiltration
Content
}
    
    try:
        resp = requests.post(url, json=data, headers=headers, timeout=10)
        result = resp.json()
        
        if resp.status_code == 200 and result.get("code") == 0:
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script performs a real ownership-transfer action against the Feishu API immediately from CLI input, but provides no confirmation prompt, dry-run mode, or explicit destructive-action warning. In the context of a skill intended to transfer document ownership, this makes accidental misuse more likely and could cause loss of control, mistaken reassignment, or unauthorized administrative changes if run with a valid tenant token.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
The file's docstrings and command-line usage/output strings are entirely in Chinese, which imposes a specific language on users without any indication of locale scope or an option to choose another language. Under the policy, language constraints should be opt-in or clearly justified as region-specific.

Static analysis

No suspicious patterns detected.