Back to skill

Security audit

Wps Macos Helper

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent WPS document-workflow guidance, but its helper script can run an unpinned external converter and overwrite caller-chosen output files, so it needs review before installation.

Install only if you are comfortable with a helper that may run an external Python converter through uvx. Prefer reviewing or pinning the converter version first, run it only on copies of documents, and choose fresh output paths that do not already exist.

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

T08 · Insecure Dependencies

Error
Location
scripts/prepare_doc_workflow.sh:26
Finding

Runtime Execution of an Unpinned Third-Party Dependency

Content
View full analysis

Vulnerability Details

File Location: scripts/prepare_doc_workflow.sh, lines 26-28
Vulnerability Type: Unpinned runtime dependency retrieval and execution
Risk Level: High

Vulnerable Code

bash
if command -v uvx >/dev/null 2>&1; then
  echo "Running: uvx --from 'markitdown[all]' markitdown '$INPUT' -o '$OUTPUT'"
  uvx --from 'markitdown[all]' markitdown "$INPUT" -o "$OUTPUT"

Technical Analysis

The script uses uvx --from 'markitdown[all]' to resolve and execute a third-party Python package at runtime. Neither the package version nor the integrity of its transitive dependencies is pinned or verified.

Consequently, the code executed by this reviewed skill is not fully determined by the contents of the skill package. It may change when a new package release is published or when the configured Python package index, package, or transitive dependency is compromised. The [all] extra can also expand the dependency set and therefore increase the supply-chain attack surface.

Shell injection through INPUT or OUTPUT is not demonstrated here because those variables are correctly passed as quoted arguments. The risk instead arises from executing mutable external dependency code.

Attack Path

  1. An attacker compromises the package source, a future markitdown release, or one of the package's transitive dependencies.
  2. The user invokes prepare_doc_workflow.sh for a supported Office or PDF input and supplies an output path.
  3. The script detects that uvx is installed.
  4. uvx resolves the unpinned markitdown[all] package through its configured package index.
  5. The retrieved package and its dependencies execute with the permissions and environment of the user running the skill.
  6. Malicious dependency code can access files, environment variables, network resources, and other assets available to that user.

Impact Assessment

Successful exploitation permits arbitrary code exec ...[truncated 528 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin markitdown to a specifically reviewed version rather than resolving the latest available release:
    bash
    uvx --from 'markitdown[all]==REVIEWED_VERSION' markitdown "$INPUT" -o "$OUTPUT"
    
  2. Lock all transitive dependencies and verify cryptographic hashes. Prefer an audited lockfile or prebuilt, integrity-verified environment.
  3. Use a trusted package index explicitly and prevent dependency resolution from untrusted or user-controlled indexes.
  4. Avoid runtime installation where practical. Package reviewed dependencies with the deployment or install them through a controlled setup process.
  5. Inform the user before any package is downloaded or executed, and require explicit consent for first-time installation.
  6. Run document conversion in a sandbox with restricted filesystem access, minimal environment variables, and limited or disabled network access.
  7. Document the runtime network and dependency behavior in SKILL.md so that it is visible during review.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/prepare_doc_workflow.sh:15
Finding

Unprotected User-Controlled Output Path Can Overwrite Files

Content
View full analysis

Vulnerability Details

File Location: scripts/prepare_doc_workflow.sh, lines 15-35
Vulnerability Type: Unsafe output-file handling
Risk Level: Medium

Vulnerable Code

bash
md)
  echo "Source is Markdown. Recommended route: clean content -> convert to docx if editable office output is needed -> open in WPS for final check."
  if [ -n "$OUTPUT" ]; then
    echo "Note: Markdown input does not need markitdown. Use a dedicated Markdown-to-docx step for office editing output."
    printf '%s\n' "Recommended next step: convert '$INPUT' into docx, then open that docx in WPS on macOS for layout review." > "$OUTPUT"
    echo "Wrote workflow note: $OUTPUT"
  fi
  ;;
docx|pdf|pptx|xlsx|xls)
  echo "Recommended route: convert source to Markdown for analysis first, then rebuild or polish in docx/WPS as needed."
  if [ -n "$OUTPUT" ]; then
    if command -v uvx >/dev/null 2>&1; then
      echo "Running: uvx --from 'markitdown[all]' markitdown '$INPUT' -o '$OUTPUT'"
      uvx --from 'markitdown[all]' markitdown "$INPUT" -o "$OUTPUT"
      echo "Done: $OUTPUT"
      echo "Next step: inspect the Markdown structure, repair headings/tables if needed, then decide whether to rebuild as docx for WPS."
    else
      echo "uvx is not installed in the current environment. Cannot auto-convert right now."
      printf '%s\n' "Auto-conversion unavailable: install uv/uvx first, then rerun this step for '$INPUT'. Recommended route: convert to Markdown -> inspect structure -> rebuild as docx if WPS editing is needed." > "$OUTPUT"
      echo "Wrote fallback workflow note: $OUTPUT"
    fi

Technical Analysis

OUTPUT is supplied directly by the caller and is used as a redirection target or passed to the converter without validating the destination. The script does not check whether:

  • The output path is the same file as the input.
  • The destination already exists.
  • The destination is a symbolic li ...[truncated 1951 chars]
Remediation
View remediation

Remediation Suggestions

  1. Resolve and compare the canonical input and output paths before writing. Reject destinations that identify the input file.
  2. Refuse to overwrite an existing destination by default. Require a deliberate flag such as --force and explicit user confirmation before replacement.
  3. Reject symbolic-link destinations or securely verify that the resolved target is within an approved output directory.
  4. Create output through a temporary file in the destination directory and atomically rename it only after successful conversion:
    bash
    output_dir="$(dirname -- "$OUTPUT")"
    tmp="$(mktemp "${output_dir}/.prepare-doc.XXXXXX")"
    trap 'rm -f -- "$tmp"' EXIT
    printf '%s\n' "workflow note" > "$tmp"
    mv -n -- "$tmp" "$OUTPUT"
    trap - EXIT
    
  5. Validate that the requested destination has an appropriate output extension and is not a directory or special device.
  6. Apply the same destination checks before calling markitdown, because the converter's overwrite behavior should not be assumed to be safe.
  7. Add regression tests covering identical input/output paths, existing destinations, symbolic links, failed conversions, and paths containing spaces.
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- Use `scripts/prepare_doc_workflow.sh` for low-risk preprocessing suggestions and Markdown conversion entry points.

Rp1

Medium
Category
MCP Rug Pull
Confidence
65% confidence
Finding

uvx/uv tool run commands without ==version create a rug-pull risk.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
65% confidence
Finding

uvx/uv tool run commands without ==version create a rug-pull risk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.