Back to skill

Security audit

Office Document Editor

Security checks for vulnerabilities and agentic risk

Overview

This office-document editing skill is mostly coherent, but it includes unsafe SFTP handling and broad document transfer behavior that could expose or corrupt user files.

Install only if you are comfortable with a document editor that can read local files, download documents from URLs/SFTP, write edited outputs, and optionally upload files by SFTP. Avoid untrusted SFTP/URL inputs until path validation and dependency pinning are fixed, and do not use the PPTX slide rearrange feature on important presentations.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/fetch_file.sh:91
Finding

SFTP Batch Command Injection Through Unvalidated Paths

Content
View full analysis
"$BATCH_FILE" << EOF get $REMOTE_PATH $OUTPUT EOF # Execute SFTP sftp -b "$BATCH_FILE" "$USER_HOST" ``` ### Technical Analysis The script derives `REMOTE_PATH` from a caller-controlled SFTP URL and writes it directly into an SFTP batch file. The caller-controlled `OUTPUT` value is inserted into the same command without validation or escaping. Shell quoting around the here-document does not make its contents safe for the SFTP batch-command parser. In particular, newline characters in either value can terminate the intended `get` command and introduce another SFTP batch instruction. OpenSSH SFTP supports commands interpreted by its own command language, including local shell execution through the `!` command. Consequently, an attacker able to influence the script arguments can turn a file-retrieval operation into arbitrary command execution under the account running the Skill. ### Attack Path 1. The attacker supplies a crafted `sftp://` or `ssh://` source to `fetch_file.sh`. 2. The source contains a newline in its remote-path component followed by an additional SFTP batch instruction. 3. The script extracts the crafted value into `REMOTE_PATH`. 4. The here-document writes both the intended `get` instruction and the injected instruction into the temporary batch file. 5. `sftp -b` parses the injected line as a separate command. 6. If a local-shell instruction is injected, the command runs with the permissions and environment of the Skill process. The output filename is another injection surface if an untrusted caller can control the second script argument. ### Impact Assessment Successful exploitation can provide ...[truncated 602 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/generate_diff.py:18
Finding

Unpinned Runtime Package Retrieval and Execution via uvx

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/pptx_editor.py:112
Finding

PPTX Rearrangement Destructively Removes All Slides

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (32)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The inclusion of network file retrieval from URL/SFTP and possible upload/orchestration behavior exceeds the narrow editing purpose claimed in the description. That kind of scope creep is security-relevant because it expands attack surface to remote endpoints, credential handling, and data movement without sufficiently clear declaration or warning.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The inclusion of network file retrieval from URL/SFTP and possible upload/orchestration behavior exceeds the narrow editing purpose claimed in the description. That kind of scope creep is security-relevant because it expands attack surface to remote endpoints, credential handling, and data movement without sufficiently clear declaration or warning.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The inclusion of network file retrieval from URL/SFTP and possible upload/orchestration behavior exceeds the narrow editing purpose claimed in the description. That kind of scope creep is security-relevant because it expands attack surface to remote endpoints, credential handling, and data movement without sufficiently clear declaration or warning.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The inclusion of network file retrieval from URL/SFTP and possible upload/orchestration behavior exceeds the narrow editing purpose claimed in the description. That kind of scope creep is security-relevant because it expands attack surface to remote endpoints, credential handling, and data movement without sufficiently clear declaration or warning.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The inclusion of network file retrieval from URL/SFTP and possible upload/orchestration behavior exceeds the narrow editing purpose claimed in the description. That kind of scope creep is security-relevant because it expands attack surface to remote endpoints, credential handling, and data movement without sufficiently clear declaration or warning.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The slide reordering function removes all slide IDs from the presentation even though the comments and messages state that python-pptx does not directly support reordering and imply a non-destructive advisory behavior. In a document-editing skill, this mismatch can lead to silent data loss or corrupted output when a user requests a reorder, making it a real integrity vulnerability rather than a harmless documentation issue.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises and documents shell execution, file reads, and file writes but does not declare an explicit tool scope such as permissions or allowed-tools. This creates unnecessary ambient authority: an agent invoking the skill may access local files, uploaded media, and network-fetch helpers without a manifest-level restriction boundary.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest positions the skill as document editing, but the documentation expands it into a general document fetcher from URLs and SFTP. That discrepancy is dangerous because reviewers and users may grant trust for local editing while overlooking remote retrieval and the associated risks of importing hostile content, contacting untrusted hosts, or mishandling sensitive files.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The phrase suggesting editing of any DOCX/PPTX file from any source is overly broad and may trigger the skill in contexts beyond what is safe or intended. Overbroad activation language is risky for agent orchestration because it can cause the skill to be selected for tasks involving sensitive local files, remote content, or unsupported formats without adequate checks.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Network-based file retrieval is not strictly necessary for document editing and materially expands the attack surface. It enables the skill to pull potentially malicious documents or interact with external infrastructure, which is especially risky in an agent setting where users may not realize the skill can make networked data movements.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The docs instruct users to fetch files from URLs and SFTP but do not provide a clear warning about external network access, credential exposure, or transmission of sensitive data. In an agent environment, omission of these warnings can lead to inadvertent disclosure or retrieval from untrusted sources under the mistaken assumption that the skill is purely local.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

Creating Edit Rules

Create edits.json with your editing instructions:

json
{

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The editing workflow lacks a clear warning that commands produce modified output artifacts and that some changes, such as slide removals or overwrites, may be irreversible without backups. While more of a safety/integrity issue than classic exploitation, this can still cause loss of important user data in automated agent workflows.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a skill for both DOCX and PPTX document editing, but this implementation exclusively uses python-docx and opens files via Document(input_path), which is specific to DOCX. There is no code path for PowerPoint/PPTX editing in this file, so the implemented behavior is narrower than the stated skill description.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill is ներկայացված as a professional DOCX/PPTX editor with tracked changes and formatting preservation, but this file implements a broad file-ingestion utility instead of editing logic. While loading an uploaded/local file can support editing, network retrieval from arbitrary HTTPS and SFTP sources materially expands behavior beyond the manifest description.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script allows arbitrary retrieval of files from external HTTPS and SFTP sources without validation, allowlisting, or user-facing trust controls. In an agent environment, this expands the trust boundary, can be used to import attacker-controlled content, and may enable SSRF-style access to internal endpoints or unauthorized network interaction depending on runtime network reachability.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/fetch_file.sh (reported line 71)May include surrounding context.

sh
wget -O "$OUTPUT" "$SOURCE"
    else
        echo "❌ Error: Neither curl nor wget found"
        echo "   Please install: sudo apt install curl"
        exit 1
    fi

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The SFTP path performs remote network access and writes attacker-supplied content locally with no integrity verification, host-key handling policy, or explicit warning about trust and provenance. In practice this can result in users processing spoofed or tampered documents and may expose the environment to risky outbound connections or credential/host trust misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring and usage text are written only in Traditional Chinese, and additional user-facing messages throughout the script follow the same pattern. This imposes a specific language on users without opt-in or justification, matching the locale-policy violation criteria.

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

python
def docx_to_text(docx_path):
    """使用 mammoth 轉換 DOCX 為純文字"""
    try:
        result = subprocess.run(
            ["uvx", "mammoth", "--output-format=markdown", str(docx_path)],
            capture_output=True,
            text=True,

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes professional DOCX/PPTX editing and version control features, but this helper script shells out to uvx mammoth using subprocess.run. Spawning external processes is a broader execution capability than document editing itself and is not explicitly justified by the stated purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a document editing skill focused on professional DOCX/PPTX editing, tracked changes, formatting preservation, highlights, strikethrough, and Git version control. This script additionally implements document acquisition from web URLs and remote SFTP servers, which is a broader file-transfer capability not reflected in the description.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Editing DOCX/PPTX files does not inherently require arbitrary network access. The URL and SFTP options introduce external network interaction and remote file movement capabilities that are not justified by the manifest's stated purpose of office document editing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script prints the full generated edits.json to the terminal, which may contain sensitive document text entered by the user, such as searched phrases, replacement text, or added content. Terminal output may be logged, captured in transcripts, or visible to bystanders, causing unintended disclosure of confidential document contents.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script can upload edited documents to arbitrary SFTP destinations, creating an outbound data-transfer path for potentially sensitive files. In an office-document editing skill, this increases the risk of accidental data exfiltration because users may transmit confidential content without strong disclosure, validation, or guardrails.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.