Back to skill

Security audit

docx

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a DOCX document tool, but it includes unsafe LibreOffice macro/preload mechanisms and broader Office-file handling than its description discloses.

Review before installing. Use only in a contained workspace, avoid running it on sensitive documents until the LibreOffice macro/profile and LD_PRELOAD temp-file issues are fixed, pin and install dependencies locally, and treat PPTX/XLSX support as outside the advertised DOCX scope.

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 (3)

T09 · Insecure Skill Coding Practices

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

Predictable Temporary Shared Object Trusted for LD_PRELOAD Injection

Content
View full analysis
bool: # AF_UNIX / LD_PRELOAD shim is Linux-only; skip on Windows and macOS if not hasattr(socket, "AF_UNIX"): return False 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 ``` The returned shared object is subsequently added to LibreOffice's environment: ```python def get_soffice_env() -> dict: env = os.environ.copy() if platform.system() == "Linux": env["SAL_USE_VCLPLUGIN"] = "svp" if _needs_shim(): shim = _ensure_shim() env["LD_PRELOAD"] = str(shim) return env ``` ### Technical Analysis The shared library is stored under the fixed path `/tmp/lo_socket_shim.so`. If that path already exists, `_ensure_shim()` returns it without checking: - Whether it is a regular file or a symbolic link - Its owner or permissions - Whether its contents match the expected shim - Whether it was created by the current process - Whether another process replaced it between validation and use When AF_UNIX socket creation fails, `get_soffice_env()` places the trusted path in `LD_PRELOAD`. The operating-system loader then loads and executes the library inside every LibreOffice process started with that environment. This creates a time-of-check/time-of-use and pre ...[truncated 1849 chars]
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/accept_changes.py:17
Finding

Reusable LibreOffice Macro Profile Allows Macro Pre-Poisoning

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(): profile_uri = Path(LIBREOFFICE_PROFILE).as_uri() subprocess.run( [ get_soffice_cmd(), "--headless", f"-env:UserInstallation={profile_uri}", "--terminate_after_init", ], capture_output=True, timeout=10, check=False, env=get_soffice_env(), ) macro_dir.mkdir(parents=True, exist_ok=True) try: macro_file.write_text(ACCEPT_CHANGES_MACRO) return True except Exception as e: logger.warning(f"Failed to setup LibreOffice macro: {e}") return False ``` ### Technical Analysis The LibreOffice profile and macro use fixed paths beneath the shared system temporary directory. The profile persists across executions and is not removed after the operation. If `Module1 ...[truncated 2547 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:17
Finding

Unpinned Global npm Dependency Installation

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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Support for validating PPTX resources under ppt/... is plainly outside the declared DOCX-only scope and explicitly conflicts with the description's exclusion of spreadsheets and non-Word tasks. Cross-format behavior broadens reachable attack surface and can cause a supposedly narrow document skill to process unrelated Office content with different security assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Support for validating PPTX resources under ppt/... is plainly outside the declared DOCX-only scope and explicitly conflicts with the description's exclusion of spreadsheets and non-Word tasks. Cross-format behavior broadens reachable attack surface and can cause a supposedly narrow document skill to process unrelated Office content with different security assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Support for validating PPTX resources under ppt/... is plainly outside the declared DOCX-only scope and explicitly conflicts with the description's exclusion of spreadsheets and non-Word tasks. Cross-format behavior broadens reachable attack surface and can cause a supposedly narrow document skill to process unrelated Office content with different security assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Support for validating PPTX resources under ppt/... is plainly outside the declared DOCX-only scope and explicitly conflicts with the description's exclusion of spreadsheets and non-Word tasks. Cross-format behavior broadens reachable attack surface and can cause a supposedly narrow document skill to process unrelated Office content with different security assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Support for validating PPTX resources under ppt/... is plainly outside the declared DOCX-only scope and explicitly conflicts with the description's exclusion of spreadsheets and non-Word tasks. Cross-format behavior broadens reachable attack surface and can cause a supposedly narrow document skill to process unrelated Office content with different security assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Support for validating PPTX resources under ppt/... is plainly outside the declared DOCX-only scope and explicitly conflicts with the description's exclusion of spreadsheets and non-Word tasks. Cross-format behavior broadens reachable attack surface and can cause a supposedly narrow document skill to process unrelated Office content with different security assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Support for validating PPTX resources under ppt/... is plainly outside the declared DOCX-only scope and explicitly conflicts with the description's exclusion of spreadsheets and non-Word tasks. Cross-format behavior broadens reachable attack surface and can cause a supposedly narrow document skill to process unrelated Office content with different security assumptions.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

CRITICAL: Use smart quotes for new content. When adding text with apostrophes or quotes, use XML entities to produce smart quotes:

xml
<!-- Use these entities for professional typography -->
<w:t>Here&#x2019;s a quote: &#x201C;Hello&#x201D;</w:t>

| Entity | Character |

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

xml
<w:p>
  <w:pPr>
    <w:numPr>...</w:numPr>  <!-- list numbering if present -->
    <w:rPr>
      <w:del w:id="1" w:author="Claude" w:date="2025-01-01T00:00:00Z"/>
    </w:rPr>

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 57)May include surrounding context.

python
def get_soffice_env() -> dict:
    env = os.environ.copy()
    # SAL_USE_VCLPLUGIN=svp is Linux-only (headless rendering)
    if platform.system() == "Linux":
        env["SAL_USE_VCLPLUGIN"] = "svp"

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
100% confidence
Finding

The helper writes C source, compiles a shared object, and injects it with LD_PRELOAD into LibreOffice. For a .docx manipulation skill, this is an unnecessary and dangerous privilege expansion because it enables arbitrary interposition on libc calls inside the target process and bypasses normal application behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill clearly instructs use of shell commands, filesystem reads/writes, and environment-dependent tooling, but it does not declare an explicit tool scope such as permissions or allowed-tools. That creates unnecessary ambient authority and makes it harder to constrain execution to only the minimum capabilities needed, increasing the blast radius if the skill is misused or if downstream scripts behave unexpectedly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instruction to use a fixed author name by default without user opt-in can silently falsify attribution in tracked changes and comments. In document-review workflows, incorrect attribution can mislead recipients about who made edits, undermining auditability and potentially creating legal or compliance issues.

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/accept_changes.py (reported line 70)May include surrounding context.

python
]

    try:
        result = subprocess.run(
            cmd,
            capture_output=True,
            text=True,

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

On subprocess timeout, the function returns a success message even though LibreOffice may not have finished accepting tracked changes or saving the document. In a document-manipulation skill, this can silently produce output that still contains unaccepted revisions, causing integrity failures, workflow bypass, or unintended disclosure of redlined content when users rely on the claimed success.

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/accept_changes.py (reported line 102)May include surrounding context.

python
if not macro_dir.exists():
        profile_uri = Path(LIBREOFFICE_PROFILE).as_uri()
        subprocess.run(
            [
                get_soffice_cmd(),
                "--headless",

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill is explicitly scoped to Word document (.docx) operations, but this file also supports packaging PPTX and XLSX outputs. That scope expansion can cause the agent to perform file-generation actions outside the advertised capability boundary, weakening policy enforcement and increasing the chance of misuse or unsafe invocation in contexts where PowerPoint or Excel handling was not reviewed or intended.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module advertises itself as a simple helper for running soffice, but it also alters runtime behavior via a preload shim whose close() hook can force process termination with _exit(0). That mismatch reduces transparency and can conceal impactful behavior from reviewers, making the capability more dangerous in the context of a document skill.

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 71)May include surrounding context.

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

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

This code compiles attacker-relevant native code at runtime by invoking gcc on a source file placed in the system temp directory, then later loads the resulting shared object into another process. In a document-processing skill, creating and compiling native code materially expands execution capability and creates opportunities for tampering, race conditions, and unsafe code injection if temp-path contents are influenced.

Content

Scanner excerpt · scripts/office/soffice.py (reported line 96)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
97% confidence
Finding

The skill manifest scopes this capability to Word documents (.docx), but the implementation also accepts and processes .pptx and .xlsx files. This scope mismatch can cause the agent to operate on file types outside the declared trust boundary, increasing the chance of unintended use, unsafe transformations, or bypass of policy/tool routing assumptions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The function named 'unpack' does more than extraction: it pretty-prints XML, rewrites smart quotes, and for DOCX can merge runs and simplify tracked changes. These in-place transformations are destructive because they silently alter document structure/content during a step users and other components may assume is a lossless unpack, which can damage evidence, corrupt semantics, or strip review history.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest narrowly positions this skill around creating and manipulating Word documents (.docx files), and explicitly says not to use it for unrelated document types. This module exports PPTXSchemaValidator, indicating PowerPoint validation capability that is outside the stated DOCX/Word scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The repair_whitespace_preservation method writes changes back to each XML file when modifications are detected, but the only disclosure is a per-file repair print after the change logic and there is no confirmation prompt, docstring warning, or broader user-facing notice that the validator mutates document contents. Because this is a code file performing file writes, it should clearly disclose that running repair will alter extracted document files.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The validator invokes an external git executable solely to format text differences, which is not necessary for Word redlining validation and increases the attack surface. In environments where PATH or the runtime image is attacker-influenced, this can lead to execution of an unintended binary; even without that, it creates avoidable dependency and sandbox-escape pressure compared with a pure-Python diff.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.