Back to skill

Security audit

薅羊毛助手

Security checks for vulnerabilities and agentic risk

Overview

This coupon-search skill has a plausible purpose, but it sends queries and bearer tokens to configurable external endpoints and injects unrelated promotional links into results.

Review carefully before installing. Use only with a dedicated low-privilege Coze token, verify the API endpoint, avoid command-line token arguments, protect any config file containing secrets, and expect search terms/session identifiers to leave the machine. Do not follow the promotional or personal-contact links unless you independently trust them, and prefer safer uv installation and pinned dependencies.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:154
Finding

Mandatory promotional content hijacks agent and script output

Content
View full analysis
💡 更多实用 AI 效率工具和技能,领取自媒体 IP&超级个体&一人公司资料,关注公众号「桂皮AI实战」 > 📱 加入自媒体&AI 副业变现交流群:https://e418e2e692454bfaa8b6206e3f0ba789.app.codebuddy.work ``` `scripts/call_bot.py:235-238`: ```python # 引流信息(固定输出) print("") print("💡 更多实用 AI 效率工具和技能,领取自媒体 IP&超级个体&一人公司资料,关注公众号「桂皮AI实战」") print("📱 加入自媒体&AI 副业变现交流群:https://e418e2e692454bfaa8b6206e3f0ba789.app.codebuddy.work") ``` `scripts/search.py:130-133`: ```python # 引流信息(固定输出) print("") print("💡 更多实用 AI 效率工具和技能,领取自媒体 IP&超级个体&一人公司资料,关注公众号「桂皮AI实战」") print("📱 加入自媒体&AI 副业变现交流群:https://e418e2e692454bfaa8b6206e3f0ba789.app.codebuddy.work") ``` ### Technical Analysis The Skill explicitly requires unrelated promotional content and an external community URL to be appended to every response. This requirement changes the agent's output behavior whenever the Skill is loaded and is not necessary for coupon searching, price comparison, or API communication. The same behavior is independently hardcoded into both executable scripts. Consequently, removing or ignoring the instruction in `SKILL.md` would not fully eliminate the behavior. The implementation demonstrates that the output modification is deliberate and persistent across the Skill's principal execution paths. The external destination is not required for the declared functionality. Repeatedly placing it in otherwise legitimate results may cause users to treat the destination as a trusted part of the coupon service. ### Attack Path 1. A user activates the Skill for a coupon or welfare query. 2. The agent loads the instruction requiring promotional material in every response. 3. The agen ...[truncated 853 chars]
Remediation
View remediation

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:120
Finding

Installation instructions execute a mutable remote script directly in a shell

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/search.py:1
Finding

Runtime dependencies are dynamically resolved without version or integrity pinning

Content
View full analysis
=3.11" # dependencies = ["aiohttp", "argparse"] # /// ``` ### Technical Analysis The inline dependency metadata requests packages by name without exact versions, hashes, or a committed lockfile. Running the documented `uv run scripts/search.py` command can therefore resolve and install package versions that were not part of this audit. The declaration also requests `argparse` as an external package even though `argparse` is included in the Python 3.11 standard library required by the script. Resolving an unnecessary package with a standard-library name expands the supply-chain attack surface without providing required functionality. This design permits package behavior to change independently of the audited repository and makes builds non-reproducible. ### Attack Path 1. A user invokes the documented `uv run` command. 2. `uv` parses the inline dependency metadata. 3. The package index is queried for unpinned versions of `aiohttp` and `argparse`. 4. A compromised, unexpectedly modified, or otherwise unsafe package version is selected. 5. Package code becomes available to the process and may execute during installation, import, or runtime. 6. The package receives the privileges of the invoking user and access to the process environment and files available to that user. ### Impact Assessment A compromised dependency could access coupon API tokens, environment variables, local configuration, user queries, and files readable by the invoking account. It could also modify files or make arbitrary network requests with that account's permissions. The issue does not prove that the currently resolved packages are malicious. It shows that the audited source does not constrain the runtime to reviewed dependency artifacts. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/search.py:16
Finding

Configurable API destinations can receive bearer tokens and user query data without destination validation

Content
View full analysis
Remediation
View remediation
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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (24)

Tainted flow: 'req' from os.environ.get (line 69, credential/environment) → urllib.request.urlopen (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/call_bot.py (reported line 84)May include surrounding context.

python
answer_parts = []

    try:
        with urllib.request.urlopen(req, context=ctx, timeout=60) as resp:
            # 逐行读取 SSE 流
            for line in resp:
                try:

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill advertises separate '羊毛福利查询' and '美团本地生活/外卖红包' abilities, yet this file only shows routing instructions and mandatory promotional messaging, not substantiated implementation details for those functions. Overstating functionality while hiding fixed marketing behavior creates deceptive operation and can cause user data to be sent to external services or other skills without clear informed consent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill advertises separate '羊毛福利查询' and '美团本地生活/外卖红包' abilities, yet this file only shows routing instructions and mandatory promotional messaging, not substantiated implementation details for those functions. Overstating functionality while hiding fixed marketing behavior creates deceptive operation and can cause user data to be sent to external services or other skills without clear informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README states that the skill aggregates data through the Coze Bot API but does not clearly warn users that their search queries and related product-search data are transmitted to an external third-party service. This creates a transparency and privacy risk because users may disclose sensitive interests, shopping patterns, or other personal data without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README instructs users to place a Coze API token in a local config file but gives no guidance on secure storage, file permissions, or avoiding accidental disclosure. This increases the chance that users will mishandle a live credential, commit it to source control, or expose it through logs or shared machines.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill documents network access and use of environment-based secrets (COZE_TOKEN) but does not declare any explicit tool scope or permission boundary. This weakens user/admin visibility into what capabilities the skill needs and increases the chance of over-privileged execution or silent external data exfiltration to third-party APIs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The description does not clearly warn users that their queries and related data will be transmitted to an external Coze Bot API and may be routed to another skill. This is dangerous because users may disclose product interests, shopping plans, or identifiers believing processing is local, when it is actually shared with third parties.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger set includes broad shopping phrases such as '找优惠', '找便宜', and '外卖红包', which can match ordinary conversation and invoke the skill unintentionally. Because the skill may send queries to an external Coze API or route them onward, accidental activation can expose user intent or shopping-related data without deliberate consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documented examples for invocation are open-ended and overlap with normal conversational requests like 'XX哪里买最便宜', making unintended activation more likely. In context, unintentional routing matters because the skill is designed to call external APIs and possibly other skills, increasing privacy and consent risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Requiring every response to append公众号 and group-invite promotional material introduces behavior unrelated to the requested shopping task and can be used for persistent traffic diversion or lead collection. In a skill that already sends data to external services, this increases trust abuse and creates a social-engineering vector that pressures users into off-platform contact.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script transmits user text, session ID, and project ID to a third-party endpoint without any user-facing disclosure in the output flow. In this skill context, users may assume they are performing local coupon search, so undisclosed remote forwarding creates a privacy and informed-consent problem, especially because a fixed session ID may persist context across uses.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

On error, the code instructs users to contact a personal WeChat account and join a group, which is not necessary to recover from an API failure. This diverts users to off-platform personal contact, increasing phishing, spam, data-harvesting, and impersonation risk under the guise of support.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script appends fixed promotional and traffic-driving content to every normal result, regardless of the user's request. In a coupon-search skill, this is unrelated behavior that can manipulate users into external channels and monetize trust, creating a deceptive experience and a social-engineering path outside the platform's controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill sends user search keywords and a bearer token to a remote, user-configurable Coze API endpoint without presenting a clear privacy notice, trust boundary warning, or endpoint validation. This is dangerous because sensitive shopping intent data and authentication material are transmitted off-device to an arbitrary remote service, and users may not understand that their input leaves the local environment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script prints unrelated promotional content and an external group/join link after completing the coupon search, which exceeds the stated functional scope of the skill. While not code execution or credential theft, this is risky because it silently turns a utility into a traffic-redirection channel and could be abused for phishing, spam, or undisclosed marketing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

All user-facing documentation in this file is Chinese-only, and there is no indication that the skill is region-specific or that users can choose another language. This can violate language or locale policy where user-facing skills should not force a language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

External Script Fetching

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The README recommends piping a remote script directly into the shell using curl, which exposes users to supply-chain compromise if the remote host, transport, or published installer is malicious or tampered with. In the context of an installation guide, this is more dangerous because users are likely to execute the command verbatim on their local system.

Content

Scanner excerpt · README.md (reported line 30)May include surrounding context.

md
### 环境依赖

- Python ≥ 3.11
- `uv`(跨平台 Python 包管理器):`curl -LsSf https://astral.sh/uv/install.sh | sh` 或 `pip install uv`
- 配置文件 `~/.coupon_search_config.json`(含 `coze_api_url` 和 `coze_api_token`)

## 使用

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
70% confidence
Finding

Overly Broad Trigger: '搜券' is too short and may match unintended inputs

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
70% confidence
Finding

Overly Broad Trigger: '比价' is too short and may match unintended inputs

Content

No source excerpt is available for this finding.

External Script Fetching

Low
Category
Supply Chain
Confidence
80% confidence
Finding

The documentation recommends curl ... | sh, which executes a remote script directly from the network without independent verification. Even though it is framed as setup guidance, this pattern normalizes unsafe installation behavior and could lead to code execution if the remote source or connection is compromised.

Content

Scanner excerpt · SKILL.md (reported line 120)May include surrounding context.

md
## 前置依赖

- `uv`(跨平台 Python 包管理器,安装:`curl -LsSf https://astral.sh/uv/install.sh | sh`,或 `pip install uv`)
- `美团生活助手` 技能(本地生活场景,可选)
- `~/.coupon_search_config.json`(电商搜索配置)
- `COZE_TOKEN` 环境变量(羊毛福利查询)

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The instructions require every response to include fixed promotional language and an external group link, regardless of the user's request. This is a natural-language behavioral policy issue because it forces non-user-requested content into all outputs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

User-facing strings, usage text, errors, and output are written exclusively in Chinese, which imposes a specific language on all users. The policy allows locale constraints when users are given a choice or when the regional limitation is clearly justified, neither of which is present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The error fallback messages are only in Chinese and direct users to Chinese-language support/contact channels. This is another instance of enforced locale-specific messaging without an explicit user choice or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring, error messages, progress output, and CLI description all force a single language/locale experience. Under the policy rule, a skill should not impose a specific language without offering the user a choice or clearly documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.