Back to skill

Security audit

Bettafish Opinion Analysis

Security checks for vulnerabilities and agentic risk

Overview

This looks like a real public-opinion report skill, but its bundled document tools use unsafe LibreOffice hooks and shared temporary files that could let local tampering affect report generation.

Review this skill before installing in an environment with sensitive files. Its web research and report writing are expected, but avoid using the bundled LibreOffice conversion or tracked-change features unless the shared /tmp paths and macro validation are fixed. Open generated HTML reports with care because they may fetch third-party scripts, and avoid untrusted report topics until output escaping and filename sanitization are added.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T07 · Tool Hijacking and Spoofing

Error
Location
subskills/docx/scripts/office/soffice.py:23
Finding

Predictable LD_PRELOAD Library Enables Local Tool Hijacking

Content
View full analysis
dict: env = os.environ.copy() env["SAL_USE_VCLPLUGIN"] = "svp" if _needs_shim(): shim = _ensure_shim() env["LD_PRELOAD"] = str(shim) return env def run_soffice(args: list[str], **kwargs) -> subprocess.CompletedProcess: env = get_soffice_env() return subprocess.run(["soffice"] + args, env=env, **kwargs) _SHIM_SO = Path(tempfile.gettempdir()) / "lo_socket_shim.so" def _needs_shim() -> bool: try: s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.close() return False except OSError: return True def _ensure_shim() -> Path: if _SHIM_SO.exists(): return _SHIM_SO src = Path(tempfile.gettempdir()) / "lo_socket_shim.c" src.write_text(_SHIM_SOURCE) subprocess.run( ["gcc", "-shared", "-fPIC", "-o", str(_SHIM_SO), str(src), "-ldl"], check=True, capture_output=True, ) src.unlink() return _SHIM_SO ``` ### Technical Analysis The code uses the fixed, system-wide temporary path `/tmp/lo_socket_shim.so`. If that path already exists, `_ensure_shim()` accepts the file without checking its owner, permissions, type, integrity, or content. When Unix-domain sockets are unavailable, the path is assigned to `LD_PRELOAD` and passed to LibreOffice. `LD_PRELOAD` causes the operating-system loader to load the specified shared object before normal program libraries. A malicious shared object can execute native code through a constructor as soon as LibreOffice starts. Trusting an existing file in a shared temporary directory therefore creates a local tool-hijacking primitive. The fixed C source path also permits races and interference between concurrent processes, although the ...[truncated 1319 chars]
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Error
Location
subskills/docx/scripts/accept_changes.py:13
Finding

Predictable LibreOffice Profile Enables Macro Hijacking

Content
View full analysis
bool: macro_dir = Path(MACRO_DIR) macro_file = macro_dir / "Module1.xba" if macro_file.exists() and "AcceptAllTrackedChanges" in macro_file.read_text(): return True if not macro_dir.exists(): subprocess.run( [ "soffice", "--headless", f"-env:UserInstallation=file://{LIBREOFFICE_PROFILE}", "--terminate_after_init", ], capture_output=True, timeout=10, check=False, env=get_soffice_env(), ) macro_dir.mkdir(parents=True, exist_ok=True) ``` ### Technical Analysis The tracked-change workflow stores and executes a LibreOffice Basic macro from the predictable shared profile `/tmp/libreoffice_docx_profile`. If `Module1.xba` already exists, the validation only checks whether its text contains the string `AcceptAllTrackedChanges`. A malicious macro can include that marker while replacing the procedure body or adding additional executable behavior. The code then explicitly invokes the procedure through a `vnd.sun.star.script` URL. There are no checks for profile ownership, file permissions, symbolic links, complete expected content, or a cryptographic digest. Because the profile is persistent an ...[truncated 1340 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/report_generator.py:503
Finding

Unescaped Topic Interpolation Can Produce Script Injection and Unsafe Output Paths

Content
View full analysis
{topic} - 舆情分析报告 ``` ```html

📊 {topic} 舆情分析报告

``` ```javascript headers: {{ default: new Header({{ children: [new Paragraph("{topic} · 舆情分析报告")] }}) }}, ``` ```javascript new Paragraph({{ text: "{topic}", heading: HeadingLevel.HEADING_1, alignment: AlignmentType.CENTER }}), ``` ```javascript Packer.toBuffer(doc).then(buffer => {{ fs.writeFileSync("{topic}_舆情分析报告.docx", buffer); }}); ``` ### Technical Analysis The report topic is accepted as a function argument and directly inserted into several distinct output contexts: - HTML title and body markup - JavaScript string literals - A JavaScript filesystem output path - Natural-language generation guidance No context-specific escaping or filename normalization is applied. A crafted topic can therefore close an HTML element and inject markup, break out of a JavaScript string, or introduce path separators into the generated filename. The function returns report-generation guidance rather than directly writing the shown HTML or JavaScript. Exploitation therefore depends on the generated guidance being followed or materialized by the report-generation workflow, as intended by the Skill. ### Attack Path 1. An attacker supplies a crafted analysis topic, such as one containing `` or quote characters that terminate a JavaScript string. 2. `generate_rich_html_report()` or `generate_rich_word_report()` interpolates the topic without escaping. 3. The report-generation workflow follows the returned guidance and emits the resulting HTML or JavaScript. 4. For HTML injection, a us ...[truncated 1038 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/report_generator.py:225
Finding

Generated HTML Executes Third-Party JavaScript Without Integrity Protection

Content
View full analysis
``` ```html ``` ### Technical Analysis The generated-report guidance instructs the workflow to load executable JavaScript from external CDNs. None of the script tags includes Subresource Integrity metadata. The Chart.js reference is also not pinned to an exact version. Consequently, the effective JavaScript executed by a report can change after the Skill package has been reviewed. A compromised CDN, compromised upstream package publication, mutable unversioned package resolution, or network-layer content substitution can cause report viewers to execute code not present in this repository. Although ECharts references a specific version and D3 references a major-version path, version selection alone does not provide cryptographic integrity. ### Attack Path 1. An upstream package, CDN account, CDN delivery path, or mutable dependency endpoint is compromised or changed. 2. The generated report references the affected external script. 3. A recipient opens the HTML report while network access is available. 4. The browser downloads the external JavaScript without checking an expected cryptographic digest. 5. The browser executes the substituted script in the report's page context. 6. The malicious script reads or modifies report content or performs network operations allowed by the browser environment. ### Impact Assessment Compromised third-party JavaScript can execute with the same b ...[truncated 480 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (92)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding mentions undeclared low-level behavior such as compiling C code and injecting an LD_PRELOAD shim into LibreOffice runtime behavior. If accurate, that is a genuine security concern because runtime library injection can subvert process behavior, bypass user expectations, and materially expand the attack surface beyond the declared analytics function.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.