Back to skill

Security audit

lobsterai-report-agent

Security checks for vulnerabilities and agentic risk

Overview

This report-writing skill mostly matches its purpose, but it needs review because it can run external tooling, spawn automated sub-agents, store reference material, and use Feishu/WeChat integrations.

Review before installing. Use a dedicated workspace, set LOBAI_CHAPTERS_DIR and LOBAI_OUTPUT_DIR to controlled folders, avoid sensitive reference material unless local retention is acceptable, keep notifications on the default log channel unless Feishu/WeChat use is intentional, and remove or disable the npx Mermaid fallback unless a verified Mermaid CLI is installed.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Error
Location
src/config.py:92
Finding

Unpinned and Incorrect npm Package Execution Through npx

Content
View full analysis

Vulnerability Details

File Location: src/config.py:92-109
Vulnerability Type: Dependency confusion and unpinned package execution
Risk Level: High

Vulnerable Code

python
import subprocess
local_cli = os.path.join(
    os.path.dirname(__file__),
    'node_modules',
    '@mermaid-js',
    'mermaid-cli',
    'src',
    'cli.js'
)
local_cli = os.path.normpath(local_cli)
candidates = [
    ('local', [local_cli, '--version']),
    ('local_node', ['node', local_cli, '--version']),
    ('mmdc', ['mmdc', '--version']),
    ('npx_mmdc', ['npx', 'mmdc', '--version']),
]
for name, cmd in candidates:
    try:
        result = subprocess.run(
            cmd,
            capture_output=True,
            text=True,
            timeout=10
        )
        if result.returncode == 0:
            _mermaid_cli_cached = (
                local_cli if name in ('local', 'local_node') else cmd[0]
            )
            return _mermaid_cli_cached
    except Exception:
        continue

Technical Analysis

The Mermaid CLI discovery routine falls back to executing npx mmdc --version when earlier candidates are unavailable. Depending on the installed npm/npx version and configuration, npx may download and execute the named package from the configured npm registry when it is not already installed locally.

The package name used by the fallback is mmdc, whereas the project documentation identifies the intended dependency as @mermaid-js/mermaid-cli. No exact version or integrity hash is specified. Consequently, this fallback can execute a mutable, unreviewed registry package that is not necessarily the intended Mermaid CLI distribution.

Although the command uses an argument list rather than shell=True, preventing ordinary shell metacharacter injection, that does not mitigate package lifecycle scripts or executable code supplied by the resolved npm package.

Attack Path

  1. An attacker publishes, compromises, or otherwise controls the packa ...[truncated 1521 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the automatic npx mmdc fallback. Do not allow runtime package retrieval during CLI discovery.
  2. Require the official @mermaid-js/mermaid-cli package to be installed explicitly before execution.
  3. Pin the dependency to an audited exact version rather than using a floating version.
  4. Use a lockfile and npm integrity metadata, and install with a reproducible command such as npm ci.
  5. Resolve the executable only from a trusted, project-controlled path. Reject unknown global or registry-resolved substitutes.
  6. If automatic installation is unavoidable, use the full official package name with an exact version, require explicit user consent, and verify package integrity before execution.
  7. Run Mermaid rendering in a sandbox with:
    • No access to secrets or unrelated user files.
    • A dedicated temporary directory.
    • Restricted outbound networking.
    • Resource and process limits.
    • A low-privilege operating-system identity.
  8. Treat failure to find the verified CLI as a non-fatal rendering failure rather than attempting to fetch a replacement.
  9. Add automated tests confirming that CLI detection never contacts a package registry or installs packages.

A safer discovery approach is to accept an administrator-configured absolute executable path, validate that it points to the expected installation, and execute only that path.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (41)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill advertises a multi-agent writing pipeline, but the documented behavior includes undeclared external process execution and broad filesystem export/conversion activity. Invoking subprocesses such as Mermaid CLI and writing batch outputs without clearly declaring or constraining them is dangerous because it expands the attack surface to local command execution and uncontrolled file generation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The skill advertises a multi-agent writing pipeline, but the documented behavior includes undeclared external process execution and broad filesystem export/conversion activity. Invoking subprocesses such as Mermaid CLI and writing batch outputs without clearly declaring or constraining them is dangerous because it expands the attack surface to local command execution and uncontrolled file generation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The skill advertises a multi-agent writing pipeline, but the documented behavior includes undeclared external process execution and broad filesystem export/conversion activity. Invoking subprocesses such as Mermaid CLI and writing batch outputs without clearly declaring or constraining them is dangerous because it expands the attack surface to local command execution and uncontrolled file generation.

Content

No source excerpt is available for this finding.

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

Scanner excerpt · parallel_tracker.py (reported line 294)May include surrounding context.

python
error_seqs = {e['seq'] for e in entries if e.get('phase') == 'error'}

                # 打印进度
                os.system('cls' if os.name == 'nt' else 'clear')
                print(render_progress_table(self.tracker_file), flush=True)

                # 新完成任务时提示

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

Scanner excerpt · parallel_tracker.py (reported line 378)May include surrounding context.

python
error_seqs = {e['seq'] for e in entries if e.get('phase') == 'error'}

                # 打印进度
                os.system('cls' if os.name == 'nt' else 'clear')
                print(render_progress_table(self.tracker_file), flush=True)

                # 新完成任务时提示

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README advertises automatic retrieval from a Feishu knowledge base but does not warn users that external data may be transmitted, queried, or incorporated into report-generation workflows. In a multi-agent reporting system handling potentially sensitive feasibility-study content, this can lead to unintended disclosure of internal documents or metadata and weakens informed consent around data flows.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill documents capabilities that read environment variables, read/write files, and invoke shell commands, but it declares no explicit tool scope or permissions boundary. That makes the effective power of the skill opaque to users and host systems, increasing the risk of unintended command execution, filesystem modification, or access to sensitive local data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are extremely broad and overlap with common writing requests, so the skill may auto-activate in situations far beyond its intended niche. Over-broad activation is risky here because the skill has file, environment, shell, and notification-related behaviors, meaning it could gain control in benign chat contexts and perform higher-risk actions than the user expected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs deletion of cache and state files, including recursive removal of pycache directories and deletion of content_hashes.json, without a prominent user-facing warning about data loss or operational consequences. Even if the targets are intended for rebuild, destructive commands in a skill are dangerous because users may run them in the wrong directory or lose state unexpectedly.

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 header and usage examples are written entirely in Chinese, and the notification examples/messages are likewise Chinese-only. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is documented and justified, which it is not here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains natural-language documentation and status text entirely in Chinese, including the module description and usage examples, with no indication that language is configurable or intentionally limited to a Chinese-only context. That creates a language/locale policy concern because the skill effectively imposes a specific language on users without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The tracker writes and prints user-visible notes, monitor messages, and CLI output in Chinese throughout normal operation. Because these messages are presented to users and there is no locale setting or documented regional limitation, the skill enforces a specific language in violation of the stated policy criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill's stated purpose is coordinating and tracking multi-agent report writing. Invoking os.system to run 'clear' or 'cls' introduces shell-execution capability that is not necessary to maintain tracker state or render progress, and is broader than expected for a report-tracking helper.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The command-line monitoring loop is part of a writing-progress tracker, but it uses os.system to invoke external shell commands. That capability exceeds what is naturally required for generating feasibility-study reports or tracking chapter progress.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guide documents destructive del commands that remove cache files and output documents, but it does not clearly warn about data loss, scope, or recovery limitations before instructing users to run them. In an agent skill context, users may copy these commands verbatim, increasing the chance of accidental deletion of important files or loss of generated work.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger condition is broad enough to activate on generic writing requests, which can cause the skill to engage outside its intended feasibility-report workflow. This increases the chance of collecting unnecessary project details or reference materials from users who did not intend to invoke this specialized multi-agent process.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guide explicitly instructs the agent to write user-supplied reference material to a fixed local path on disk. That creates an undocumented data persistence behavior that can retain sensitive user content beyond the session, expose it to other processes or users on the host, and cause cross-run data leakage if the file is later reused.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instructions tell the system to save reference materials locally without warning the user that their data will be stored on disk. Because reference materials may contain confidential business, policy, or personal information, undisclosed local retention creates a privacy and compliance risk and may violate user expectations around ephemeral processing.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The hard-coded insertion of a local directory into sys.path causes the runtime to trust and import Python modules from a user-writable or environment-specific path without integrity verification. If that directory is replaced or tampered with, the agent can import malicious code and execute arbitrary local functionality under the agent's privileges.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The guide explicitly instructs child agents to perform Feishu knowledge-base retrieval, fallback web searches, and later send WeChat notifications, which expands the skill from report drafting into external data access and outbound communications. In a multi-agent automated workflow, these actions can leak prompts, document topics, keywords, or progress metadata to third-party services without clear authorization or disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The guide instructs automatic saving to F:/agent/chapters and updating plan.json state without any explicit warning or confirmation, creating silent file-system and metadata side effects. In an automated agent setting, undisclosed writes can overwrite user data, create persistence artifacts, or alter workflow control files in ways the operator did not expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The batch flow is designed to run automatically across all batches, spawn parallel subagents, wait in the background, and convert outputs to docx without user confirmation. Fully autonomous execution increases the blast radius of mistakes or prompt abuse because many actions occur before a human can inspect intermediate outputs, state changes, or external side effects.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Automatic WeChat notification capability is unrelated to core document generation and creates an outbound communication channel from an otherwise local writing workflow. This can expose report progress, filenames, project names, or other sensitive metadata to an external messaging service without a clear business necessity or user approval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented automatic WeChat notification lacks any privacy warning even though it may send project progress and other operational details to an external service. In enterprise or feasibility-study contexts, even metadata about report generation can be confidential, making undisclosed transmission a meaningful privacy and compliance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The title and core instruction state the formatting standard entirely in Chinese and direct sub-agents to follow it strictly, but there is no indication that language selection is optional or limited to a China-specific workflow. This can violate language/locale policy when a skill forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.