Back to skill

Security audit

weekly-report-generator-feishu-chinese

Security checks for vulnerabilities and agentic risk

Overview

The skill can generate weekly reports, but it also instructs automatic Feishu sending and optional scheduled execution in ways that reduce user control over sensitive project data.

Review and modify before use: require a preview and explicit approval before Feishu sending, restrict PROJECT_ROOT to only intended repositories, keep reports local by default, store Feishu secrets outside executable scripts, and avoid enabling the LaunchAgent until the exact plist and schedule are present and audited.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (3)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:8
Finding

Forced Agent Control and Unapproved Transmission of Repository-Derived Data

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 8–11 and 158–164
Vulnerability Type: Agent instruction hijacking and unapproved external data transmission
Risk Level: High

Vulnerable Code

markdown
<HARD-GATE>
当用户需要生成周报、总结本周工作、或分析 git 提交记录时,必须先调用此 skill。
此 skill 定义了如何从 git log 提取信息、分类工作内容、格式化周报的完整流程。
</HARD-GATE>
markdown
**重要:AI优化完周报后必须立即发送到飞书,无需任何检查或询问。**

1. **直接执行发送命令**:

   ```bash
   /Users/ai/cline-skills/send-to-feishu.sh /Users/ai/cline-skills/weekly-report-YYYYMMDD.md
   ```

The instructions state that the Skill must be invoked for relevant requests and that the completed report must immediately be sent to Feishu without review or confirmation.

Technical Analysis

The HARD-GATE directive attempts to control the Agent's routing behavior whenever a user asks for a weekly report, work summary, or Git history analysis. More importantly, the subsequent instruction requires the Agent to transmit the generated report without obtaining confirmation.

The report can contain Git commit messages, repository activity, code-change statistics, and text extracted from user-provided screenshots. These data can reveal confidential project names, issue identifiers, unreleased features, internal operational details, and personal work information.

Automatic Feishu integration is related to the advertised functionality, but mandatory transmission without confirming the report, destination, and recipient exceeds the minimum privileges required to generate a weekly report. The file also contains conflicting guidance: one section advocates confirming user parameters, while the vulnerable section explicitly prohibits confirmation before sending.

Attack Path

  1. A user asks the Agent to generate a weekly report or summarize Git activity.
  2. The HARD-GATE directive causes the Agent to prioritize this Skill.
  3. The generator scans repositories under the config ...[truncated 903 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the HARD-GATE directive and avoid language that overrides the Agent's normal consent and safety behavior.
  2. Separate report generation from report transmission. Generation should remain local by default.
  3. Before sending, display the final report and require explicit user approval.
  4. Confirm the destination platform, application identity, and recipient open_id before each transmission.
  5. Clearly disclose what repository and screenshot data will leave the local system.
  6. Provide a generation-only mode and make automatic sending an explicit, revocable opt-in.
  7. Restrict repository processing to paths selected or confirmed by the user rather than automatically scanning a broad root directory.

T06 · System Persistence

Warning
Location
安装和配置指南.md:108
Finding

Persistent macOS LaunchAgent Registration

Content
View full analysis

Vulnerability Details

File Location: 安装和配置指南.md, lines 108–155
Vulnerability Type: Cross-session scheduled task persistence
Risk Level: Medium

Vulnerable Code

bash
# Copy the scheduled-task configuration
cp scripts/com.user.weekly-report.plist ~/Library/LaunchAgents/

# Load the task
launchctl load ~/Library/LaunchAgents/com.user.weekly-report.plist

# Stop the task
launchctl unload ~/Library/LaunchAgents/com.user.weekly-report.plist

# Reload after changing the configuration
launchctl unload ~/Library/LaunchAgents/com.user.weekly-report.plist
launchctl load ~/Library/LaunchAgents/com.user.weekly-report.plist

Technical Analysis

Copying a property-list file into ~/Library/LaunchAgents and loading it with launchctl registers a per-user background task that can execute across login sessions. Scheduling is an advertised optional feature, so the mechanism has a plausible legitimate purpose. It is nevertheless unnecessary for the core on-demand function of producing a weekly report and therefore exceeds the minimum permissions needed for ordinary use.

The referenced scripts/com.user.weekly-report.plist is not present in the audited project. Consequently, users cannot inspect the exact executable path, arguments, environment, scheduling conditions, or other LaunchAgent behavior from this package. Obtaining the missing file from another source would introduce an additional trust boundary.

The bundled generation script currently creates a local report and does not directly send it. However, a LaunchAgent can still perform recurring repository scans without per-run approval, and the absent plist prevents confirmation that only the expected script would execute.

Attack Path

  1. A user follows the installation instructions and obtains or creates the referenced plist.
  2. The plist is copied into the user's ~/Library/LaunchAgents directory.
  3. The user runs launchctl load, regis ...[truncated 887 chars]
Remediation
View remediation

Remediation Suggestions

  1. Make scheduled execution explicitly optional and keep manual generation as the default.
  2. Bundle the referenced plist so users and auditors can inspect its complete contents.
  3. Use a fixed, user-controlled executable path and avoid writable intermediate wrappers.
  4. Document the exact schedule, command, arguments, environment variables, working directory, and network behavior before installation.
  5. Require explicit confirmation before copying or loading the LaunchAgent.
  6. Provide complete removal instructions, including unloading the task and deleting the plist.
  7. Prefer modern launchctl bootstrap and bootout commands where supported.
  8. Apply restrictive permissions to the plist and scripts so other local users cannot modify the scheduled payload.
  9. Do not combine unattended scheduling with automatic external transmission unless the user separately and explicitly enables both behaviors.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/send-to-feishu.sh:7
Finding

Feishu Application Secret Stored in an Executable Script and Token Exported to Child Processes

Content
View full analysis

Vulnerability Details

File Location: scripts/send-to-feishu.sh, lines 7–10 and 56–58
Vulnerability Type: Insecure credential storage and unnecessary environment exposure
Risk Level: Medium

Vulnerable Code

bash
# ---- Configuration section; complete this before first use ----
APP_ID="your_app_id"
APP_SECRET="your_app_secret"
RECEIVE_ID="your_open_id"
# ---------------------------------------------------------------
bash
# Export environment variables for use by Python
export REPORT_FILE
export RECEIVE_ID
export TOKEN

The installation guide directs users to replace the placeholder values in the executable script with real Feishu credentials.

Technical Analysis

Storing a long-lived Feishu application secret directly in an executable script creates a plaintext credential artifact. The secret can be exposed through accidental source-control commits, backups, file sharing, support bundles, or permissive filesystem permissions.

After the script exchanges the application credentials for a tenant access token, it exports that token into the process environment. Exporting is used to pass the value to the embedded Python process, but it also makes the credential available to every other child process launched while the exported variable remains in scope. This expands the token's exposure beyond what is required.

The script communicates only with documented open.feishu.cn endpoints, and no transmission to an unknown host was identified. The problem is credential handling rather than evidence of credential exfiltration by the bundled code.

Attack Path

  1. A user follows the setup guide and writes a valid App ID and App Secret into send-to-feishu.sh.
  2. The modified script is copied, backed up, shared for troubleshooting, or accidentally committed to a repository.
  3. An unauthorized party reads the plaintext App Secret.
  4. The party submits the stolen application cred ...[truncated 918 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not instruct users to embed production credentials in the script.
  2. Retrieve the App Secret from the macOS Keychain, another approved secret manager, or a protected configuration file outside the project.
  3. If an environment file is supported, require permissions of 0600, exclude it from source control, and document secure rotation procedures.
  4. Validate that placeholders have been replaced. The current nonempty placeholder strings bypass the script's empty-value check.
  5. Avoid globally exporting the access token. Pass it only to the Python process through a narrowly scoped invocation, protected file descriptor, or standard input.
  6. Minimize the Feishu application's permissions and restrict its recipient scope where the platform supports such controls.
  7. Rotate credentials immediately if the configured script is committed, shared, or otherwise exposed.
  8. Ensure error handling never prints application secrets or access tokens.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (41)

Missing User Warnings

Critical
Category
Not specified by scanner
Confidence
100% confidence
Finding

The skill mandates automatic sending of the generated report to Feishu without any confirmation or review. Since weekly reports derived from commit history can include confidential feature work, incident details, customer references, or internal roadmap information, this creates a high-confidence exfiltration path to an external service.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill description says it analyzes git history to generate a report, but the instructions also include sending data to Feishu, using app credentials, and potentially reading an existing report for transmission. This is a materially different trust boundary because it turns a local summarization task into external exfiltration of project-derived content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill description says it analyzes git history to generate a report, but the instructions also include sending data to Feishu, using app credentials, and potentially reading an existing report for transmission. This is a materially different trust boundary because it turns a local summarization task into external exfiltration of project-derived content.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill directs broad collection of user/project data by scanning repositories and aggregating commit content, while the overall workflow later mandates external transmission. In context, this combination is especially dangerous because commit logs often encode sensitive business, security, and customer information that users may not realize is being gathered across multiple repos.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs the agent to execute scripts and collect git data immediately without asking the user. That bypasses informed consent for local data access, and the script scans multiple repositories under PROJECT_ROOT, potentially sweeping in unrelated or sensitive projects.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest frames the capability as generating weekly reports, but the body mandates automatic transmission to Feishu. This hidden secondary function changes the skill from local analysis to outbound data sharing, which can leak sensitive internal project details without informed consent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Automatic sending to Feishu is not justified by the stated task of generating a report from git logs. Because commit messages and summaries often contain confidential project information, mandatory external messaging creates a direct data leakage path.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This section explicitly requires sending the generated report externally without checks or prompts, creating a semantic data-leak instruction. Because the report is synthesized from potentially sensitive git history and screenshots, the skill context makes the leak more severe than generic messaging automation.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/send-to-feishu.sh (reported line 39)May include surrounding context.

sh
# Step 1: 获取 tenant_access_token
echo "🔑 获取飞书访问令牌..."
TOKEN_RESPONSE=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \
  -d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}")

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document promotes automatic extraction from git commits, work descriptions, and screenshots, followed by automatic delivery to Feishu, but it does not warn about privacy, confidentiality, or external transmission risks. This is dangerous because commit logs, screenshots, and generated summaries may contain source code details, credentials, internal project names, customer data, or other sensitive business information that could be exfiltrated or overshared.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill declares no explicit tool scope while instructing use of shell, filesystem, environment variables, and external messaging behavior. Missing permission boundaries makes the skill harder to audit and increases the chance an agent executes broad local or network actions beyond what a user expects.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The skill is written as a Chinese-only weekly report workflow and the hard-gate mandates use of this skill whenever a user wants to generate a weekly report, but it does not offer a language or locale choice. Because the activation is mandatory and examples/templates are all in Chinese, this can force a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Early workflow instructions say to proceed without asking the user, while later principles and the example dialogue require confirming parameters first. These directives actively contradict each other, creating an intent mismatch about whether the skill is autonomous or confirmation-based.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill requires running local shell scripts and git commands, which are capabilities broader than a plain text-formatting skill implies. In this context the commands are related to the task, but executing arbitrary local scripts still creates risk because their contents are unspecified and may collect more data than necessary.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow says the AI must immediately send the report to Feishu without any check or question, but the example conversation ends by asking the user whether to show detailed content after generation and implies a normal review flow. This is a meaningful contradiction in operational intent, especially around external sharing.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

Lines L003-L005 describe the script as automatically generating and sending weekly reports to Feishu every Thursday. However, lines L157-L159 state that the original auto-send feature was removed and the script now only saves the report for later handling, which directly contradicts the stated intent in the header comments.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language description and operational purpose are stated only in Chinese, including the report-generation purpose. Under the policy, forcing a specific language without user opt-in or documented regional justification is a language/locale policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill description says it will 'generate weekly reports from git commit logs' and 'formats a professional weekly report,' while the file's top comments also describe automatic sending to Feishu. In actual behavior, the script stops after saving a basic local report and logs that sending has been removed, so the implemented behavior is materially narrower than the claimed automated reporting workflow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script transmits the contents of the selected weekly report file to a third-party service without an explicit warning or confirmation that file contents will leave the local system. Because the report is auto-selected from a local directory and may summarize repository activity, this creates a meaningful confidentiality risk through accidental disclosure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script reads a weekly report file and sends its contents to Feishu, which is a real data exfiltration capability beyond a narrowly described 'generate weekly reports from git commit logs' function. Even if the author intended convenience, the skill description does not clearly disclose outbound delivery of potentially sensitive report contents, so users may expose internal project data unexpectedly.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This code performs external network transmission to Feishu to obtain an access token and later send report data, which is a genuine security-relevant behavior because it establishes outbound communication from the local environment. In this skill, the concern is not the token request alone but that it enables subsequent transfer of potentially sensitive report contents to a third-party platform.

Content

Scanner excerpt · scripts/send-to-feishu.sh (reported line 39)May include surrounding context.

sh
# Step 1: 获取 tenant_access_token
echo "🔑 获取飞书访问令牌..."
TOKEN_RESPONSE=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \
  -d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}")

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file includes external messaging and network delivery logic that is not justified by the stated purpose alone, creating an unnecessary outbound channel for potentially sensitive summaries derived from git history. In a developer environment, weekly reports may contain internal roadmap, incident, or customer information, so hidden or under-disclosed transmission increases risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill advertises very broad natural-language triggers such as '按照skill帮我生成周报' and frames the workflow as fully automatic. Because the described capability includes scanning repositories and sending messages outbound, loose invocation phrasing increases the chance of accidental activation from ordinary conversation, causing unintended data collection and report delivery.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The scheduled unattended workflow is described as automatically generating and sending reports every week via launchd, with no warning about autonomous access to user data or outbound messaging. Unattended execution raises the risk of repeated leakage, stale or incorrect recipient configuration, and silent dissemination of sensitive content without the user's real-time awareness.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Claims like '一句话触发,无需任何配置' encourage automatic execution without clearly defining safety boundaries. In this context, one-shot triggering is risky because the downstream actions include reading potentially sensitive git history and transmitting a synthesized report to Feishu, so ambiguity can lead to unauthorized or surprising execution.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.