Back to skill

Security audit

Feishu Power Skill

Security checks for vulnerabilities and agentic risk

Overview

This Feishu automation skill mostly matches its stated purpose, but an undocumented scheduler feature can run arbitrary local Python with the user's environment and Feishu credentials.

Install only after reviewing or removing the custom report runner, and run schedules only from trusted YAML files. Use a least-privilege Feishu app, keep FEISHU_APP_ID and FEISHU_APP_SECRET out of shared files and logs, review publish destinations before enabling scheduled publication, and install dependencies in an isolated environment with pinned versions where possible.

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

Error
Location
scripts/report_generator.py:238
Finding

Undocumented Arbitrary Python Script Execution Through Schedule Configuration

Content
View full analysis
Dict: """Execute a custom script report. params: script, args(list) """ import subprocess params = job.get("params", {}) script = params["script"] if not os.path.isabs(script): script = os.path.join(SCRIPT_DIR, script) cmd = [sys.executable, script] + params.get("args", []) result = subprocess.run(cmd, capture_output=True, text=True, timeout=300) return { "type": "custom", "script": script, "returncode": result.returncode, "stdout": result.stdout[-2000:] if result.stdout else "", "stderr": result.stderr[-1000:] if result.stderr else "", } REPORT_RUNNERS = { "audit": run_audit_report, "template": run_template_report, "custom": run_custom_report, } ``` ### Technical Analysis The report scheduler accepts a user-supplied YAML schedule and dispatches jobs according to their `type`. Registering `custom` in `REPORT_RUNNERS` allows a schedule to specify an arbitrary Python file in `params.script`. Absolute paths are accepted without restriction. Relative paths are joined to the script directory but are not normalized or checked for traversal, so values containing `../` can also resolve outside the intended directory. There is no script allowlist, trusted-directory restriction, ownership or permission validation, signature verification, explicit confirmation, or environment isolation. Although `subprocess.run()` uses an argument list rather than a shell and therefore avoids conventional shell metacharacter injection, it still deliberately executes the selected file as Python code. The process inherits the scheduler's user privileges, working environment, and sensitive environment variables, including ...[truncated 2006 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
install.sh:40
Finding

Unpinned Dependencies Installed From the Active pip Package Index

Content
View full analysis
/dev/null || pip install --quiet requests pyyaml info "Dependency installation completed" } ``` ### Technical Analysis The recommended installer resolves `requests` and `pyyaml` dynamically from the user's active pip index without exact version constraints or cryptographic hashes. The installer also does not require a known package index, verify a lock file, or create an isolated virtual environment. The package names are established packages and no typosquatting was identified. Nevertheless, installation remains dependent on mutable upstream releases and the user's pip configuration. A compromised package release, configured mirror, index, or dependency resolution path could introduce unreviewed code during installation. The fallback from `pip3` to `pip` can also select a different Python installation or package environment. Depending on the local configuration, packages may be installed globally or into another shared environment, increasing the scope of dependency conflicts and supply-chain impact. ### Attack Path 1. The user follows the documented installation procedure and runs: ```bash bash install.sh ``` 2. The installer invokes `pip3`, or falls back to `pip`. 3. pip contacts the configured package index or mirror and resolves the latest compatible versions of `requests`, `pyyaml`, and their transitive dependencies. 4. If the configured source or a resolved package release is compromised, malicious package code is downloaded and installed. 5. The malicious dependency code can execute during package installation or later when imported by the Skill. Exploitation requires compromise or malicious control of an applicable packa ...[truncated 740 chars]
Remediation
View remediation
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (38)

Tainted flow: 'APP_ID' from os.environ.get (line 22, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/feishu_api.py (reported line 42)May include surrounding context.

python
if _token_cache["token"] and _token_cache["expires_at"] > now + 60:
        return _token_cache["token"]

    resp = requests.post(
        f"{BASE_URL}/auth/v3/tenant_access_token/internal",
        json={"app_id": APP_ID, "app_secret": APP_SECRET},
        timeout=10,

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

This finding includes arbitrary custom script execution via subprocess, which is materially different from the benign Feishu automation description and can enable execution of unintended commands. When a skill presents itself as a domain automation helper but can invoke arbitrary scripts, users and agents may grant trust that exceeds the real risk surface.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

This finding includes arbitrary custom script execution via subprocess, which is materially different from the benign Feishu automation description and can enable execution of unintended commands. When a skill presents itself as a domain automation helper but can invoke arbitrary scripts, users and agents may grant trust that exceeds the real risk surface.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

This finding includes arbitrary custom script execution via subprocess, which is materially different from the benign Feishu automation description and can enable execution of unintended commands. When a skill presents itself as a domain automation helper but can invoke arbitrary scripts, users and agents may grant trust that exceeds the real risk surface.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · install.sh (reported line 58)May include surrounding context.

sh
echo "    export FEISHU_APP_ID=cli_xxx"
        echo "    export FEISHU_APP_SECRET=xxx"
        echo ""
        echo "  或创建 .env 文件后 source 加载。"
        echo ""
    else
        info "飞书凭证已配置 (APP_ID: ${FEISHU_APP_ID:0:8}...)"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% 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).

Content

Scanner excerpt · install.sh (reported line 117)May include surrounding context.

sh
local lines
        lines=$(wc -l < /tmp/feishu-skill-test.md)
        info "Demo 审计通过 — 生成 ${lines} 行报告"
        rm -f /tmp/feishu-skill-test.md
    else
        warn "Demo 审计未通过(不影响安装,可能是环境问题)"
    fi

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This report generator is presented as Feishu reporting automation, but it includes a generic custom-script runner that can invoke any local Python file with attacker-chosen arguments from scheduled jobs. In the skill context, that substantially broadens the attack surface from document/report generation to full local code execution on the host running the scheduler.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill explicitly instructs users to export long-lived Feishu credentials and describes workflows that publish data to Feishu, but it does not warn about secret handling, scope minimization, or the fact that local data will be transmitted to external Feishu services. In an automation skill that performs batch table operations, document generation, and scheduled reporting, this omission can lead to accidental credential exposure or unintended external data disclosure by users who treat the instructions as safe defaults.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill description and usage guidance are presented in Chinese throughout the README, and there is no indication that this language choice is optional or tied to a justified region-specific requirement. This can constitute a natural-language locale policy issue when a skill effectively forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises installation and execution of Python scripts that use environment variables, local files, network access, and shell execution, but it does not declare any tool scope or permission boundaries. In an agent setting, that omission can cause the agent to invoke powerful capabilities without explicit user awareness or policy gating, increasing the chance of unintended data access, file modification, or external API actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Broad trigger phrases like general Feishu automation terms can cause the skill to activate in contexts where the user did not intend powerful automation, especially given the skill's ability to write files, call APIs, and publish outputs. Overbroad activation increases the risk of accidental execution of sensitive actions from casual or ambiguous requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill documents report/document generation with options that can publish to Feishu, but it does not clearly warn users that generated content may be sent externally to Feishu services. That omission can lead to unintentional disclosure of sensitive business data when users expect only local rendering or preview behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The scheduled job configuration supports automatic publishing of reports and indicates jobs can run on a timer, yet the description lacks a clear warning that publication may occur without per-run confirmation. In an agent environment, unattended scheduled publishing can repeatedly exfiltrate internal operational data or create unauthorized documents if misconfigured or abused.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This manifest includes a live configuration template with publish: true and a folder_token, indicating reports may be sent to an external document/storage destination. The file does not include any warning about data disclosure, publication side effects, or the need to verify that the destination is appropriate before enabling publishing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The weekly summary template shows app_token, table_id, and publish: true, implying retrieval of real data and publication of generated output, but the YAML comments do not warn about privacy, data handling, or destination review. Because this is a manifest/config file describing skill behavior, omission of such warnings can leave operators unaware of the impact when uncommenting and enabling it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

This template uses real data identifiers and sets publish: true, which indicates scheduled generation and outward publication of an operational report. The surrounding comments describe setup but do not disclose the privacy or integrity implications of automatically publishing report contents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The snapshot function exports the full table contents, including record fields and the app_token, into a local JSON file without any sensitivity checks, redaction, encryption, or explicit operator warning. In an automation skill handling business tables, this creates a realistic risk of local data leakage, credential exposure, and over-retention if the host filesystem is shared, backed up, or otherwise accessible.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code fetches table records and then creates and populates a Feishu document using API calls, which transmits potentially user-provided or organizational data to an external service. Although this is core functionality, there is no confirmation prompt or user-facing disclosure in the CLI flow that the selected Bitable contents will be uploaded into a new remote document.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/feishu_api.py (reported line 42)May include surrounding context.

python
if _token_cache["token"] and _token_cache["expires_at"] > now + 60:
        return _token_cache["token"]

    resp = requests.post(
        f"{BASE_URL}/auth/v3/tenant_access_token/internal",
        json={"app_id": APP_ID, "app_secret": APP_SECRET},
        timeout=10,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

These helpers perform irreversible record deletions with no built-in confirmation, guardrail, dry-run mode, or policy check. In an agentic context, that raises the risk of accidental or prompt-induced destructive actions against production business data, especially given the skill's bulk-automation focus.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document block deletion helper issues destructive content changes without any user-facing warning or safety interlock. In a document-generation and reporting skill, this can lead to accidental loss or tampering of reports and knowledge content if invoked by mistake or via manipulated prompts.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The exported API surface includes Wiki and Drive management capabilities that are broader than the declared skill purpose centered on Bitable automation, reporting, and audits. This scope expansion increases the blast radius if the agent is prompted to act outside expected boundaries, enabling access to or modification of broader Feishu content than users may reasonably anticipate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains natural-language strings that define how users are expected to understand and operate the skill, and they are presented only in Chinese. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale limitation is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/report_generator.py (reported line 55)May include surrounding context.

python
os.environ["FEISHU_APP_ID"] = "_placeholder_"
        os.environ["FEISHU_APP_SECRET"] = "_placeholder_"
        patched = True
    mod = __import__(name)
    _modules[name] = mod
    if patched:
        os.environ.pop("FEISHU_APP_ID", None)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
97% confidence
Finding

The code executes a Python script path and argument list taken from the job configuration, which allows arbitrary code execution whenever an attacker can modify the YAML schedule or otherwise influence job params. Although shell injection is avoided by passing a list to subprocess.run, this is still an explicit arbitrary-script execution feature.

Content

Scanner excerpt · scripts/report_generator.py (reported line 250)May include surrounding context.

python
script = os.path.join(SCRIPT_DIR, script)

    cmd = [sys.executable, script] + params.get("args", [])
    result = subprocess.run(cmd, capture_output=True, text=True, timeout=300)
    return {
        "type": "custom",
        "script": script,

Static analysis

No suspicious patterns detected.