Back to skill

Security audit

cloud-doc-intelligent-assistant

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it claims, but its instructions overreach by requiring activation whenever certain cloud providers are merely mentioned.

Review the activation rules before installing: this skill should only be used for explicit cloud documentation retrieval, comparison, change checks, or monitoring, not every mention of a cloud provider. Enable webhook and .env loading only if you are comfortable sending change summaries to configured endpoints and importing local .env values into the skill process.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:105
Finding

Overbroad mandatory invocation rules hijack agent tool selection

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:105-107
Vulnerability Type: Agent instruction hijacking through unconditional activation rules
Risk Level: Medium

Vulnerable code, translated faithfully into English:

markdown
1. If the user mentions Alibaba Cloud, Tencent Cloud, Baidu Cloud, or Volcano Engine → **this Skill must be invoked**
2. If the user asks about cloud product functionality without specifying a provider → **first ask which cloud provider the user means**, then invoke the Skill after confirmation
3. If the user mentions multiple cloud providers and requests a comparison → use `compare_docs` to retrieve both documents and perform the comparison

Technical Analysis

The first two activation rules are broader than the Skill's legitimate documentation-retrieval and monitoring purpose. They require invocation whenever a supported provider is merely mentioned, even if the user did not request documentation retrieval, comparison, change detection, or monitoring.

Skill metadata and instructions are loaded into the agent's instruction context and can influence its tool-selection decisions. The unconditional phrase “must be invoked” overrides intent-based selection and causes the Skill to claim conversations outside its necessary scope. The second rule additionally forces an unnecessary clarification for generic cloud questions that the agent may be able to answer without this Skill.

Once invoked, the selected operation may read the local documentation database, write documentation or cache data locally, or contact public cloud-provider APIs. These operations are legitimate when explicitly requested, but they exceed minimum privilege when triggered solely by a provider mention.

Attack Path

  1. The agent loads SKILL.md, including its mandatory invocation rules.
  2. A user mentions one of the supported cloud providers in a request that does not require current documentation, such as a g ...[truncated 1591 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace provider-name-based mandatory activation with explicit, intent-scoped criteria. Invoke the Skill only when the user requests current documentation retrieval, document comparison, change detection, or monitoring.
  2. Remove all unconditional “must invoke” language. Recommended wording:
    markdown
    Use this Skill when the user explicitly requests retrieval, comparison, or monitoring of current documentation for a supported cloud provider. Do not invoke it merely because a provider is mentioned.
    
  3. Do not force clarification for generic cloud questions unless provider-specific, current documentation is necessary to answer accurately.
  4. Before an operation that performs network access or persistent writes, ensure the requested action clearly requires those effects. Ask for confirmation when intent is ambiguous.
  5. Document which operations are local-only and which perform network access so the agent can select the least-privileged operation.
  6. Add activation tests verifying that incidental provider mentions do not trigger the Skill and that only explicit documentation or monitoring requests activate it.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (64)

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 · src/config.py (reported line 10)May include surrounding context.

python
import yaml

# .env 加载(默认禁用,需显式 opt-in)
def _load_dotenv():
    """从项目根目录的 .env 文件加载环境变量(默认不加载,需设置 CLOUD_DOC_MONITOR_LOAD_DOTENV=1 启用)"""
    # 默认不加载,必须显式启用

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 · src/config.py (reported line 12)May include surrounding context.

python
import yaml

# .env 加载(默认禁用,需显式 opt-in)
def _load_dotenv():
    """从项目根目录的 .env 文件加载环境变量(默认不加载,需设置 CLOUD_DOC_MONITOR_LOAD_DOTENV=1 启用)"""
    # 默认不加载,必须显式启用

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 · src/config.py (reported line 18)May include surrounding context.

python
return
    
    for search_dir in [Path.cwd(), Path(__file__).parent.parent]:
        env_file = search_dir / ".env"
        if env_file.exists():
            with open(env_file, "r", encoding="utf-8") as f:
                for line in f:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description is written as an unconditional operational instruction set in Chinese and requires invocation behavior without any indication that users may interact in other languages. This can violate language/locale policy when a skill effectively assumes a fixed language or locale 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

The design section states '本 skill 只负责数据采集' and limits scope to fetching documents, storing them in SQLite, and detecting changes, while also emphasizing it does not perform higher-level analysis. Later examples document run_monitor(..., send_notification=True) and state 'run_monitor 发送通知', which is an additional outward action beyond pure data collection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and CLI usage text are presented only in Chinese, and the runtime messages shown to users are likewise Chinese-only. This imposes a specific language on all users without offering a language choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The command-line help and error strings printed to users are exclusively in Chinese. Because the file does not offer a language selection mechanism or state a justified regional scope, this is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstrings and user-facing descriptions are entirely in Chinese, which imposes a specific language on users or maintainers without offering a language/locale choice. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

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 exposes natural-language output and usage instructions entirely in Chinese, including the module docstring and runtime help text. That forces a specific language on users without opt-in, which matches the policy-violation category for language or locale constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The printed usage and error messages are only available in Chinese, with no alternative locale or user-configurable language option. For a general CLI, this is a natural-language policy issue unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code uses Chinese-only natural-language strings in the module docstring and user-facing exception messages, which indicates a fixed language choice. The policy for this category requires flagging language constraints when the skill does not provide user opt-in or clearly justify the locale limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The request parameters force language: "zh" and website: "cn", which imposes a specific locale in code rather than allowing user opt-in or configuration. This matches the language/locale policy violation category because the skill behavior is restricted to Chinese without an explicit choice mechanism.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The search request always sends language: "zh" together with website: "cn", so all searches are constrained to Chinese-language content. There is no indication in this file that users can choose another language or that the locale restriction is justified and documented.

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 · src/notifier.py (reported line 39)May include surrounding context.

python
}
        for attempt in range(1, self.retry_count + 1):
            try:
                response = requests.post(self.url, json=payload, timeout=self.timeout,
                                         headers={"Content-Type": "application/json"})
                response.raise_for_status()
                return True

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code sends notification title, summary, timestamp, and metadata to an external webhook endpoint via HTTP, which can expose user or system data outside the local environment. Although errors are logged, there is no confirmation prompt, user-facing disclosure, or explanatory comment/docstring warning that notification contents will be transmitted externally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The notifier sends message text and per-user recipient identifiers to a remote webhook, which is a network operation transmitting potentially sensitive change information. The code lacks a visible warning, confirmation, or explanatory docstring/comment informing users that document change details and user identifiers are sent to an external service.

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 · src/notifier.py (reported line 132)May include surrounding context.

python
}
        for attempt in range(1, self.retry_count + 1):
            try:
                response = requests.post(self.webhook_url, json=payload, timeout=self.timeout,
                                         headers={"Content-Type": "application/json"})
                response.raise_for_status()
                result = response.json()

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code performs an HTTP POST to an external webhook containing notification title and markdown text derived from document changes. There is no confirmation prompt, user-facing notice, or inline documentation warning that potentially sensitive change summaries will be transmitted to a third-party service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file begins with a natural-language description in Chinese ("检测文档变更"), and user-facing response strings throughout the skill are also hard-coded in Chinese. This indicates a fixed language/locale choice without any opt-in, selection mechanism, or documented region-specific justification, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The comment at L046 says the skill re-fetches each document and compares versions, and the human summary at L086/L088 presents results as '最近 {days} 天内' changes. However, although cutoff is computed at L051, it is never used, so any detected difference is reported regardless of when the change occurred. This is an intent/documentation mismatch rather than a mere omission because the code explicitly frames output as bounded by the requested day range.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The module docstring states the skill purpose entirely in Chinese (获取两个云厂商的产品文档供客户端对比), and all user-facing messages in this file are also hardcoded in Chinese. This indicates a fixed language behavior without opt-in or locale choice, which matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file begins with a Chinese-only natural-language description, and all user-facing response strings in the skill are also hardcoded in Chinese. This indicates a locale-specific behavior without any visible user opt-in or documented justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The module docstring says this skill '抓取指定云厂商的产品文档' (fetches vendor product docs), but the _fetch_product docstring specifically states '从本地数据库搜索已存储的文档'. In this file, product mode indeed performs only local storage search, while the user-facing summary at L098 tells users to use fetch_doc+doc_ref to actually crawl remote docs, creating a meaningful intent/documentation divergence about what the skill does in product mode.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code uses Chinese in the module docstring, parameter validation errors, logging, notification titles, and generated markdown summary, with no indication that users can choose a different language or locale. That creates a natural-language policy issue if the organization requires language choice rather than a forced locale.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The docstring at L112 describes the method as reading stored documents from a local database and re-fetching for comparison, but the implementation also persists fresh documents via storage.save at L127 and L130. This is an intent-level contradiction because the documentation suggests a read/compare operation while the code performs state-changing writes.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.