Back to skill

Security audit

飞书群Webhook发送图片

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says: it uploads a user-chosen local image to Feishu and posts it to a configured group webhook, with some setup and credential-handling risks users should manage.

Install only if you intend to send selected local images to Feishu. Treat `APP_SECRET` and `WEBHOOK_URL` as credentials, keep `config.py` private, avoid committing it, grant the Feishu app only the minimum image permission needed, and avoid using the skill for sensitive images unless sharing them to that group is intended.

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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:28
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 28-32
Vulnerability Type: Unpinned dependency and non-reproducible installation
Risk Level: Medium

Complete Code Snippet:

markdown
### 2. Install dependencies

```bash
pip install requests
text

### Technical Analysis

The installation instructions retrieve the latest version of `requests` and its transitive dependencies at installation time. No exact version, integrity hash, lock file, or reviewed package index is specified. The code subsequently imports and executes this package in `send_image.py`.

This makes the installed code non-reproducible and allows its behavior to change after the Skill has been reviewed. A compromised upstream release, dependency-chain compromise, unsafe package-index configuration, or malicious package mirror could introduce attacker-controlled code into the runtime environment.

There is no evidence that the current `requests` package is malicious. The vulnerability is the absence of controls ensuring that users install the same reviewed dependency artifact.

### Attack Path

1. An attacker compromises an applicable package release, transitive dependency, configured package index, or package mirror.
2. A user follows the documented `pip install requests` instruction.
3. `pip` resolves and installs the attacker-controlled or compromised artifact because no version or hash is enforced.
4. The user invokes `send_image.py`.
5. Python imports the installed `requests` package, executing its module initialization code.
6. Malicious dependency code runs with the privileges of the user executing the Skill.

### Impact Assessment

Successful exploitation could provide arbitrary code execution under the invoking user's account. That code could access files, environment variables, and network resources available to that user, including the Feishu credentials loaded during normal operation. The dependency itself does no
...[truncated 142 chars]
Remediation
View remediation

Remediation Suggestions

  1. Create a dependency file containing an exact, reviewed version of requests and exact versions of all transitive dependencies.
  2. Record cryptographic hashes for every accepted distribution and install with:
    bash
    pip install --require-hashes -r requirements.txt
    
  3. Generate and review a lock file using an established dependency-management tool.
  4. Install dependencies in a dedicated virtual environment rather than a shared or privileged Python environment.
  5. Use only trusted package indexes and explicitly configure the approved index where practical.
  6. Add automated dependency and vulnerability scanning while ensuring updates are reviewed before changing the lock file.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:14
Finding

Plaintext Storage of Feishu Application Secret and Webhook Credential

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 14-24
Vulnerability Type: Plaintext sensitive credential storage
Risk Level: Medium

Complete Code Snippet:

markdown
### 1. Configuration parameters

Copy the configuration template and enter the actual configuration:

```bash
cp config.example.py config.py

Ask for the parameters and update the config.py file:

python
APP_ID = "cli_xxx"           # Feishu application ID
APP_SECRET = "xxx"           # Feishu application secret
WEBHOOK_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/xxx"  # Group bot webhook URL
text

The corresponding runtime loading behavior appears in `send_image.py`, lines 8-30:

```python
# Import configuration
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
CONFIG_FILE = os.path.join(SCRIPT_DIR, "config.py")

def load_config():
    """Load configuration"""
    if not os.path.exists(CONFIG_FILE):
        print("❌ Configuration file does not exist!")
        print("Create the configuration file first:")
        print("  1. cp config.example.py config.py")
        print("  2. Edit config.py and enter APP_ID, APP_SECRET, and WEBHOOK_URL")
        sys.exit(1)
    
    # Add the script directory to the path
    sys.path.insert(0, SCRIPT_DIR)
    
    try:
        from config import APP_ID, APP_SECRET, WEBHOOK_URL
    except ImportError as e:
        print(f"❌ Invalid configuration file: {e}")
        sys.exit(1)
    
    # Check whether the configuration is valid
    if "your_" in APP_ID or "your_" in APP_SECRET or "your_" in WEBHOOK_URL:
        print("❌ Enter the actual configuration in config.py first!")
        print("The current configuration is a template; replace APP_ID, APP_SECRET, and WEBHOOK_URL")
        sys.exit(1)
    
    return APP_ID, APP_SECRET, WEBHOOK_URL

Technical Analysis

The documented setup requires users to store ` ...[truncated 2432 chars]

Remediation
View remediation

Remediation Suggestions

  1. Load APP_ID, APP_SECRET, and WEBHOOK_URL from environment variables or an operating-system or cloud secret manager.
  2. If local file storage must remain available, use a non-executable configuration format and create the file with owner-only permissions, such as mode 0600 on compatible systems.
  3. Add config.py and other local secret files to .gitignore. Also provide a pre-commit secret-scanning configuration.
  4. Avoid importing a credential file as executable Python. Parse a narrowly defined configuration format and validate each field.
  5. Validate that the webhook uses HTTPS and, where operationally appropriate, belongs to the expected Feishu hostname.
  6. Grant the Feishu application only the API permissions required to upload and send images.
  7. Document immediate revocation and rotation procedures for an exposed application secret or webhook URL.
  8. Ensure error and diagnostic output never includes application secrets, access tokens, or complete webhook URLs.
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)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill performs network actions (uploading images to Feishu and sending them via webhook) but does not declare any explicit tool scope or permissions boundary. This creates a transparency and governance gap: an agent or user may invoke the skill without a clear, machine-readable indication that local files will be transmitted to an external service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill says it uploads local images to Feishu and sends them to a group, but it lacks an explicit user-facing warning that invoking it will exfiltrate a local file to a third-party service and distribute it through a webhook. In agent settings, that omission can cause users to provide sensitive local paths or images without understanding the external disclosure risk.

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 · send_image.py (reported line 42)May include surrounding context.

python
def get_tenant_access_token(app_id, app_secret):
    """获取 tenant_access_token"""
    url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
    resp = requests.post(url, json={
        "app_id": app_id,
        "app_secret": app_secret
    })

External Transmission

Medium
Category
Data Exfiltration
Confidence
81% confidence
Finding

The script posts data to a fully configurable webhook URL from local configuration with no validation or allowlist enforcement. In this skill's context, that means a user who misconfigures or is tricked into supplying an attacker-controlled webhook could cause outbound transmission of message content and enable unauthorized posting, making the external transmission pattern security-relevant.

Content

Scanner excerpt · send_image.py (reported line 76)May include surrounding context.

python
def send_to_webhook(image_key, webhook_url):
    """通过 webhook 发送图片"""
    resp = requests.post(webhook_url, json={
        "msg_type": "image",
        "content": {
            "image_key": image_key

Vague Triggers

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest description says the skill uploads a local image to Feishu and sends it to a group via webhook, but it does not define any explicit trigger phrases, scope limitations, or exclusion conditions. In a manifest file, this kind of broad natural-language description can lead to ambiguous invocation because it does not clarify when the skill should or should not be selected.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code includes user-facing comments, error messages, and CLI usage text entirely in Chinese, which effectively forces a specific language for interaction. The file does not provide any opt-in, locale selection, or justification that it is intentionally limited to a Chinese-only audience.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.