Back to skill

Security audit

corp-innovation-brief

Security checks for vulnerabilities and agentic risk

Overview

The skill’s business-report purpose is coherent, but its optional HTML export uses unsafe Python/file-writing patterns that can turn report content or company names into active code or unintended file writes.

Install only if you trust the MCP environment and are comfortable reviewing exports before opening them. Avoid exporting reports for attacker-supplied company names or content until the exporter is changed to use data-only inputs, sanitized filenames, contained output paths, and safe HTML rendering.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:134
Finding

Python Code Injection Through Untrusted Report Export Values

Content
View full analysis
>""" company_name = "<<企业名称>>" report_date = "<<报告日期>>" ``` The instructions later require these placeholders to be replaced with the actual report, company name, and report date before executing the generated script. ### Technical Analysis The export workflow constructs executable Python source by substituting data into Python string literals. Both `company_name` and portions of `report_md` can originate from user input or externally retrieved report material. No safe serialization boundary is defined. A value containing quotation marks, backslashes, newlines, or a triple-quote sequence can terminate the intended string literal and introduce additional Python statements. Escaping the content for HTML after the Python interpreter has started does not mitigate this issue because exploitation occurs while parsing the generated Python source. The vulnerability is especially significant for `report_md`, which may contain material derived from public web searches in addition to user-supplied data. ### Attack Path 1. An attacker supplies a company name or report-influencing input containing a Python string terminator and injected Python statements. 2. The Agent produces the Step 7 report using that input. 3. The report export workflow asks the user to approve HTML generation. 4. After approval, the Agent replaces the placeholders in the documented script with the actual values. 5. The Python tool parses the substituted text as executable source. 6. The injected statements execute with the permissions granted to the Python tool. ### Impact Assessment Successful exploitation can provide arbitrary Python code execution in the Skill runtime. Depending on the sandbox configuration, this may permit: - Reading files an ...[truncated 547 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:224
Finding

Path Traversal Through Unsanitized Export Filename

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:170
Finding

HTML and Unsafe-Link Injection in Exported Reports

Content
View full analysis
\1', line) line = re.sub(r'\*(.+?)\*', r'\1', line) line = re.sub(r'\[([^\]]+)\]\(([^)]+)\)', r'\1', line) if re.match(r'^[-*]\s+', line): line = '
  • ' + line[2:] + '
  • ' elif re.match(r'^\d+\.\s+', line): line = '
  • ' + re.sub(r'^\d+\.\s+', '', line) + '
  • ' elif line.strip() == '---': line = '
    ' elif line.strip() == '': line = '
    ' else: line = '

    ' + line + '

    ' html_lines.append(line) ``` The resulting content is then inserted directly into the HTML document: ```python {body_html} ``` ### Technical Analysis The custom Markdown converter escapes headings, table cells, and fenced code, but it does not escape ordinary paragraph or list content before inserting it into HTML. It also inserts Markdown link text and link destinations directly into an anchor element. Consequently: - Raw HTML in ordinary report lines can become active markup. - Attribute-breaking characters in link destinations can introduce additional attributes. - Dangerous schemes such as `javascript:` are not rejected. - Externally sourced report content can cross from a data context into an executable browser context. Because the report incorporates user input and public web-search material, an attacker may influence content that is later exported. The generated file is self-contained HTML intended to be opened in a browser, making this a stored client-side injection issue. The use of `target="_blank"` without `rel="noopener noreferrer"` also permits the opened page to interact with the opener in browser configurations where opener isolation is not automatically applied. ### Attack Path 1. An attacker supplies malicious company-related ...[truncated 1163 chars]
    Remediation
    View remediation
    ` tags, event-handler attributes, quote-breaking link targets, `javascript:` URLs, and malicious content obtained from external search results. ]]>
    Vulnerability Patterns
    • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
    • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
    • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
    • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
    • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
    Findings (9)

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    98% confidence
    Finding

    The declared description presents this skill as an operational end-to-end enterprise innovation and credit analysis generator that automatically searches data sources and produces a completed structured brief. The supplied code does not do that. It only validates inputs, defines a report_data schema, and writes a placeholder Markdown report with empty/default fields and '待 Agent 填充' sections. Comments explicitly state that actual retrieval and assembly are performed elsewhere by an agent using external tools. Therefore, the code chunk's actual behavior materially underdelivers relative to the declared purpose, making this a clear description-behavior mismatch.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    99% confidence
    Finding

    There is a clear material mismatch between the declared description and the actual code behavior. The description promises a fully functional enterprise innovation assessment and credit analysis briefing workflow, including external data collection and structured analytical output. The code chunk contains only a minimal stub entry script that prints a readiness message and performs none of the described tasks. No triggers or permissions are declared, but the primary issue is that the implemented behavior is effectively absent relative to the claimed functionality.

    Content

    No source excerpt is available for this finding.

    Undeclared Tool Scope

    Medium
    Category
    MCP Least Privilege
    Confidence
    92% confidence
    Finding

    The skill instructs the agent to use Python to write an HTML report and to read an environment variable (EUREKA_PYTHON_OUTPUT_DIR), but the skill manifest does not declare any corresponding tool scope or allowed-tools restrictions. This creates a capability-governance gap: an agent/runtime may permit broader file or environment access than the skill documentation communicates, increasing the chance of unintended file writes or misuse if the skill is modified or if report content contains unsafe data.

    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, error message, report template, and status prints are all written in Chinese, and the script does not provide any mechanism for language or locale selection. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

    Content

    No source excerpt is available for this finding.

    Intent-Code Divergence

    Medium
    Category
    Not specified by scanner
    Confidence
    91% confidence
    Finding

    The top-level documentation says the script outputs 'report.md' as a structured briefing and 'data.json' as raw aggregated data for debugging, which implies real analysis output. However, the implementation writes a mostly empty report marked '暂待 Agent 填充' and a report_data object with empty lists/default values, contradicting the documented behavior.

    Content

    No source excerpt is available for this finding.

    Description-Behavior Mismatch

    Medium
    Category
    Not specified by scanner
    Confidence
    98% confidence
    Finding

    The manifest describes a skill that automatically retrieves patents, papers, and public web data, then outputs a substantive six-part briefing. In this file, the comments explicitly state that actual retrieval is performed elsewhere by the agent, while the script itself only defines placeholders and writes a template report with empty/default fields.

    Content

    No source excerpt is available for this finding.

    Tainted flow: 'report_path' from os.environ.get (line 110, credential/environment) → open (file write)

    Medium
    Category
    Data Flow
    Confidence
    94% confidence
    Finding

    The script uses EUREKA_PYTHON_OUTPUT_DIR directly from the environment to build report_path and then writes to it without validation. If an attacker can influence that environment variable, they can redirect writes to arbitrary filesystem locations, causing file overwrite or clobbering within the permissions of the running process.

    Content

    Scanner excerpt · scripts/corp_innovation_pipeline.py (reported line 113)May include surrounding context.

    python
    report_path = os.path.join(output_dir, "report.md")
    data_path   = os.path.join(output_dir, "data.json")
    
    with open(report_path, "w", encoding="utf-8") as f:
        f.write(report_md)
    
    with open(data_path, "w", encoding="utf-8") as f:
    

    Tainted flow: 'data_path' from os.environ.get (line 111, credential/environment) → open (file write)

    Medium
    Category
    Data Flow
    Confidence
    94% confidence
    Finding

    The same untrusted output_dir value is used to construct data_path and write data.json. An attacker controlling the environment could cause sensitive or important files to be overwritten, and because this file contains structured data, it could also be abused to plant attacker-controlled JSON in a trusted location.

    Content

    Scanner excerpt · scripts/corp_innovation_pipeline.py (reported line 116)May include surrounding context.

    python
    with open(report_path, "w", encoding="utf-8") as f:
        f.write(report_md)
    
    with open(data_path, "w", encoding="utf-8") as f:
        json.dump(report_data, f, ensure_ascii=False, indent=2)
    
    print(f"[corp_innovation_pipeline] 骨架报告已写出:{report_path}")
    

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    90% confidence
    Finding

    The markdown specifies report_lang as optional with a default of 简体中文, which imposes a language choice when the user does not explicitly select one. The policy allows locale constraints only when the user is offered a choice or the constraint is clearly justified as region-specific; here a choice exists, but the default still forces a specific language without opt-in.

    Content

    No source excerpt is available for this finding.