Back to skill

Security audit

Auto Insight Engine

Security checks for vulnerabilities and agentic risk

Overview

The skill describes a public-source insight collector, but its executable wrapper loads unreviewed Python code from an external local directory before validating the requested action.

Review this skill before installing. Its public-source collection and trend persistence are plausible for an insight engine, but the package does not contain the core engine it executes; it imports code from an external local db directory. Only use it in an environment where that directory is administrator-controlled, reviewed, and least-privileged, and confirm what data may be sent to NVIDIA NIM or written into a knowledge base.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (1)

T07 · Tool Hijacking and Spoofing

Warning
Location
auto_insight_engine.py:8
Finding

Executable Module Hijacking Through a Predictable External Import Path

Content
View full analysis

Vulnerability Details

File Location: auto_insight_engine.py, lines 8–19
Vulnerability Type: Untrusted external module loading and Python import-path hijacking
Risk Level: Medium

Vulnerable Code

python
_SRC = Path(__file__).parent.parent.parent / "db"


def run(query: str = "status") -> dict:
    """执行洞察引擎
    Args:
        query: run | status | trends
    Returns:
        dict: 操作结果
    """
    sys.path.insert(0, str(_SRC))
    try:
        from auto_insight_engine import run_cycle, get_engine_status

Technical Analysis

The skill derives a db directory outside the audited package, inserts that directory at the beginning of the process-wide Python module search path, and imports executable code from a module named auto_insight_engine.

Given the audited project location, the expression traverses three parent directories and can resolve to a predictable shared location such as /tmp/db. The imported implementation is not included in the audited project, so neither its integrity nor its behavior can be verified. Python executes module-level statements while importing a module, meaning a malicious file can execute code before run_cycle or get_engine_status is called.

Placing the external directory at index zero gives its modules precedence over most normal import locations. The global sys.path modification also remains active after the function returns, potentially affecting later imports in the same Python process.

The import occurs before the requested operation is validated. Consequently, requests for status, trends, and even unsupported operations can reach the vulnerable import statement.

The documentation identifies a Windows source path, D:\coze-local\db\auto_insight_engine.py, while the implementation calculates a relative external path. This mismatch makes the actual trust boundary ambiguous and increases the chance of loading an unintended module. Depending ...[truncated 2282 chars]

Remediation
View remediation

Remediation Suggestions

  1. Package the engine implementation inside the skill and use an explicit package-relative import with a distinct module name, for example:

    python
    from .engine_impl import run_cycle, get_engine_status
    
  2. Do not modify the process-wide sys.path to load executable components. This prevents path-precedence attacks and unintended effects on later imports.

  3. Validate query before loading operation-specific code. A trends or invalid request should not import the engine implementation when it is unnecessary.

  4. If an external implementation is unavoidable:

    • Resolve it from an administrator-controlled, non-temporary directory.
    • Reject symbolic links and verify the resolved canonical path.
    • Require restrictive directory and file permissions.
    • Verify the file against a pinned cryptographic hash or authenticated signature before loading it.
    • Load it under a unique, fully qualified module name rather than the generic auto_insight_engine name.
    • Avoid leaving external directories in the global import path.
  5. Align the documented source location with the implemented location and explicitly document the ownership, deployment, and integrity requirements for the external component.

  6. Run the skill under a least-privileged account or sandbox with restricted filesystem, credential, subprocess, and network access to limit the impact of any future module-loading compromise.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description says the skill collects insights from six external sources, performs deep analysis via NVIDIA NIM, and ingests into a knowledge bridge, but it does not warn users that network access, third-party processing, and persistence may occur. Missing disclosure undermines informed consent and can expose users to privacy, compliance, and unexpected outbound-data risks.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises a primary source at a local Python path, but the provided content is a Markdown knowledge log with merged learning snippets and trigger rules. This mismatch impairs auditability and can conceal the actual executable behavior from reviewers, increasing the risk of unreviewed code being invoked under benign-looking documentation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger condition activates on a broad request for related help rather than a narrowly scoped command. In a skill that performs collection from multiple external sources and downstream analysis, vague activation can cause unintended execution, data retrieval, or external calls without sufficiently explicit user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This trigger similarly allows activation from a generic request for help related to the learned sub-skill. Because the skill ecosystem appears to auto-merge and expand triggers from learned content, generic phrasing can unintentionally route user requests into unrelated or network-capable behaviors.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module title and docstrings present the skill as '本地化技能' and all user-facing descriptions/messages are written in Chinese, with no indication that the user can choose another language. This is a natural-language locale policy concern because it imposes a specific language experience by default rather than offering opt-in or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The primary descriptive content is presented in Chinese and the document does not indicate that users may choose another language or locale. This can violate language-choice policy when a skill imposes a language without opt-in or justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The top-level documentation describes the skill as an 'automatic insight engine' that gathers insights from six sources and tracks trends. In this file, the actual behavior is a thin wrapper that imports another module, invokes run_cycle/get_engine_status, and reads a local JSON file for trends; the documented collection behavior is not present here. This is an intent/documentation mismatch within the file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.