Back to skill

Security audit

wps-office-suite

Security checks for vulnerabilities and agentic risk

Overview

This is a broad office-automation skill with useful disclosed features, but it has review-worthy risks around unsafe file opening, optional data upload to configurable LLM/cloud endpoints, and long-running or scheduled automation.

Review this before installing if you handle sensitive documents. Avoid external LLM/cloud modes unless the endpoint and credentials are trusted, do not use doc_search --open on shared or untrusted folders, and inspect any watch YAML rules or scheduled tasks before enabling automation.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/doc_search.py:296
Finding

Shell Command Injection Through Search-Result Filename

Content
View full analysis

Vulnerability Details

File Location: scripts/doc_search.py:296
Vulnerability Type: OS command injection
Risk Level: Medium

Vulnerable code:

python
if args.open and results:
    top = results[0]
    try:
        os.startfile(top["file"]) if sys.platform == "win32" else os.system(f'xdg-open "{top["file"]}"')
        print(f"📂 已打开:{top['file']}")
    except Exception as e:
        print(f"⚠️ 打开失败:{e}")

Technical Analysis

The non-Windows path interpolates top["file"] into a command string passed to os.system(). This API invokes a system shell, so the selected document path is parsed as shell syntax rather than passed solely as an argument to xdg-open.

top["file"] originates from filenames discovered beneath the directory selected for indexing. The filename and document content can therefore be controlled by an independent contributor when the searched directory is shared, synchronized, downloaded, or otherwise accepts third-party documents.

Wrapping the path in double quotes is insufficient. Unix filenames may contain double quotes and other shell-significant characters. A filename can terminate the quoted argument and append another command. Command substitution expressions may also be evaluated inside double quotes.

The vulnerable operation is reached when:

  1. The Skill runs on a non-Windows platform.
  2. A search directory contains an attacker-supplied document with a malicious filename.
  3. The document is made the highest-ranked result by including content relevant to the query.
  4. The user invokes the search operation with --open.

The user authorizes opening the highest-ranked document, but does not authorize executing shell commands encoded in its filename. This crosses the trust boundary between untrusted filesystem metadata and shell execution.

Attack Path

  1. An attacker places a supported document in a directory later searched by the victim. Supported i ...[truncated 1316 chars]
Remediation
View remediation

Remediation Suggestions

Remove shell invocation and pass the selected path as a separate subprocess argument:

python
if sys.platform == "win32":
    os.startfile(top["file"])
elif sys.platform == "darwin":
    subprocess.run(["open", top["file"]], check=False)
else:
    subprocess.run(["xdg-open", top["file"]], check=False)

Also apply the following hardening measures:

  1. Resolve the selected result path with Path.resolve().
  2. Resolve the user-selected search root and verify that the result remains beneath that root using Path.relative_to() or an equivalent containment check.
  3. Confirm that the target is a regular file before opening it.
  4. Do not attempt to fix this by manually escaping shell characters; eliminating the shell is the reliable remediation.
  5. Add regression tests using filenames containing quotes, semicolons, dollar signs, command substitutions, backticks, spaces, and newlines.
Vulnerability Patterns
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • 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
Findings (316)

Tainted flow: 'req' from os.environ.get (line 194, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
96% confidence
Finding

When the user explicitly selects an external translation method, the code sends document content and a bearer token derived from environment variables to a network endpoint whose base URL is also environment-controlled. This creates a real data exfiltration path for potentially sensitive document contents, and if the endpoint variable is misconfigured or attacker-controlled, credentials and document data may be sent to an untrusted host.

Content

Scanner excerpt · scripts/document_translator.py (reported line 204)May include surrounding context.

python
)
        
        try:
            with urllib.request.urlopen(req, timeout=60) as resp:
                result = json.loads(resp.read().decode("utf-8"))
                translated = result["choices"][0]["message"]["content"]
                return {"text": translated}

Tainted flow: 'req' from os.environ.get (line 728, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
93% confidence
Finding

The code builds a request target from OPENAI_BASE_URL and sends meeting transcript content plus an API key to that remote endpoint. Because the base URL is environment-controlled and there is no allowlist or trust validation, sensitive meeting data and credentials can be exfiltrated to an attacker-controlled server.

Content

Scanner excerpt · scripts/meeting_minutes.py (reported line 738)May include surrounding context.

python
)
        
        try:
            with urllib.request.urlopen(req, timeout=30) as resp:
                result = json.loads(resp.read().decode("utf-8"))
                content = result["choices"][0]["message"]["content"]
                return {"summary": {"raw": content}, "structured": False}

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description is materially inconsistent with the documented and analyzed behavior, including undeclared subprocess, network, telemetry, task scheduling, repair, and file-manipulation capabilities. Security review depends on truthful capability disclosure; major mismatch makes it easier to hide risky behavior and prevents informed consent by users.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.