Back to skill

Security audit

Xlsx Cn

Security checks for vulnerabilities and agentic risk

Overview

This is a real Excel-processing skill, but it uses under-scoped LibreOffice automation that can inject native code and leave persistent macro changes, so it belongs in Review before installation.

Install only if you are comfortable running this in an isolated environment. Back up both Office documents and any existing LibreOffice macros first, and avoid using it on untrusted Office files until the LD_PRELOAD shim, persistent macro setup, and archive extraction limits are addressed.

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

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/office/soffice.py:24
Finding

Predictable Temporary LD_PRELOAD Library Enables Local Code Execution

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 shared library and its C source are created at globally predictable paths under the system temporary directory: - `/tmp/lo_socket_shim.so` - `/tmp/lo_socket_shim.c` The implementation trusts any existing `lo_socket_shim.so` without checking its ownership, permissions, file type, content, or cryptographic digest. It also does not reject symbolic links or create the files atomically. When Unix-domain socket creation fails, the existing library is assigned to `LD_PRELOAD` and a LibreOffice subprocess is launched. The operating system consequently loads and executes initialization code from that library before LibreOffice starts. This creates both a pre-creation attack and a race condition. A local attacker who can write to the shared temporary dire ...[truncated 1404 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/recalc.py:17
Finding

Spreadsheet Recalculation Overwrites Persistent LibreOffice Macro State

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/office/unpack.py:52
Finding

Untrusted Office Archives Are Extracted Without Resource Limits

Content
View full analysis
Remediation
View remediation
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 (42)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Unlike the other TP4 entries, this one aligns with text in the skill: it instructs execution of external LibreOffice via shell and references a helper that 'automatically configures LibreOffice' in sandboxed environments. If that helper compiles code, uses LD_PRELOAD, or bypasses socket restrictions as described, the skill is materially more dangerous than its benign Excel-processing description suggests because it attempts environment-level sandbox circumvention.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Setting LD_PRELOAD changes dynamic-linker behavior for spawned processes and allows interception of libc/socket functions inside LibreOffice. In an Excel-processing skill, this is an unjustified capability escalation that can mask behavior, bypass environmental restrictions, and create a powerful code-injection point if the preload target is replaced or influenced.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/office/soffice.py (reported line 25)May include surrounding context.

python
def get_soffice_env() -> dict:
    env = os.environ.copy()
    env["SAL_USE_VCLPLUGIN"] = "svp"

    if _needs_shim():

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill compiles a native LD_PRELOAD shim on demand, which is far beyond ordinary spreadsheet processing needs and introduces arbitrary native-code execution capability into the workflow. That makes the component much more dangerous because compromise of the build path, temp directory artifacts, or shim source handling could affect every spawned LibreOffice process.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file implements Word DOCX tracked-change validation, not Excel/XLSX processing as claimed by the skill manifest. This capability mismatch is dangerous because it hides broader document-handling behavior than users or reviewers expect, weakening trust boundaries and increasing the chance that unsafe or unnecessary code paths are shipped under misleading metadata.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill explicitly instructs use of file I/O and shell execution, including running a recalc script and assuming LibreOffice is installed, but it declares no tool scope restrictions. That mismatch increases the chance an agent will grant broader-than-necessary capabilities or execute this skill without proper sandboxing and approval boundaries.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrases include very broad terms like 'Excel' and '表格', which can match many ordinary user requests and cause the skill to activate in contexts the user did not intend. Because the skill includes file manipulation and shell-assisted recalculation workflows, overbroad triggering increases accidental invocation risk and unintended file access or modification.

Content

No source excerpt is available for this finding.

Behavior Manipulation

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Subtle instructions detected that may alter agent decision-making or introduce hidden biases.

Content

Scanner excerpt · SKILL.md (reported line 104)May include surrounding context.

CRITICAL: Use Formulas, Not Hardcoded Values

Always use Excel formulas instead of calculating values in Python and hardcoding them. This ensures the spreadsheet remains dynamic and updateable.

❌ WRONG - Hardcoding Calculated Values

python

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes an Excel/XLSX processing skill for creating, reading, and editing spreadsheets, but this file operates on WordprocessingML content under word/document.xml and merges DOCX text runs. That is a different document format and editing domain than spreadsheets, so the implemented behavior exceeds the stated Excel-focused purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The function writes modified XML back to word/document.xml, changing the user's document contents in place. Although the module docstring explains the transformation, there is no confirmation prompt, warning message, or explicit disclosure near the write operation that the original extracted document content will be overwritten.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/office/soffice.py (reported line 37)May include surrounding context.

python
def run_soffice(args: list[str], **kwargs) -> subprocess.CompletedProcess:
    env = get_soffice_env()
    return subprocess.run(["soffice"] + args, env=env, **kwargs)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
97% confidence
Finding

This code compiles native C source at runtime and produces a shared object in a world-writable temporary directory, then relies on it for later process injection. In the context of an Excel-processing skill, runtime native compilation materially expands the attack surface and can enable local code-execution or file-replacement races if another local actor can tamper with the temp files.

Content

Scanner excerpt · scripts/office/soffice.py (reported line 59)May include surrounding context.

python
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,

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes an Excel spreadsheet processing skill for creating, reading, and editing Excel files, but this file explicitly handles DOCX, PPTX, and XLSX and performs DOCX-only transformations such as merging runs and simplifying tracked changes. Those capabilities materially expand the skill beyond Excel processing and are not an obvious implementation detail of spreadsheet handling.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The suffix check and subsequent logic explicitly support .docx and .pptx in addition to .xlsx, and DOCX files receive extra modification steps. This does not match a manifest centered on Excel spreadsheets and xlsx trigger words.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill manifest describes an Excel-processing capability focused on creating, reading, and editing spreadsheets with formulas, charts, and data analysis. This module is instead a command-line validator for Office document XML, and its logic only supports DOCX/PPTX validators while explicitly rejecting unsupported file types such as .xlsx in the dispatch logic.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.