Back to skill

Security audit

PPT压缩大师!自动压缩PPT里面的视频和图片素材,压缩率高达 90%!

Security checks for vulnerabilities and agentic risk

Overview

This skill has a clear PPT compression purpose, but it can download and run unverified executables and install packages during normal use.

Review carefully before installing. Use only on trusted PPTX files, avoid running the generated python -c commands with untrusted messages or unusual filenames, preinstall Pillow and ffmpeg through trusted channels, and do not use the included ffmpeg downloader unless you independently verify the downloaded binaries.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:149
Finding

Arbitrary Code Execution Through Unsafe Python Command Interpolation

Content
View full analysis
'''); print(paths[0] if paths else 'NO_PATH_FOUND')" ``` ```bash python -c "import sys; sys.path.insert(0, r'{SKILL_DIR}/scripts'); from path_helper import validate_path; r = validate_path(r'<提取到的路径>'); print(f'Valid: {r[\"valid\"]}, Size: {r[\"size_mb\"]}MB' if r['valid'] else f'Error: {r[\"error\"]}')" ``` ```bash python -c "import sys; sys.path.insert(0, r'{SKILL_DIR}/scripts'); from compress_ppt_videos import run; run(r'<验证后的路径>')" ``` ```python python -c " import sys sys.path.insert(0, r'{SKILL_DIR}/scripts') from compress_ppt_videos import compress_pptx compress_pptx(r'') " ``` The path helper also generates an executable command by directly interpolating a validated path: ```python if result['valid']: print(f"可以使用以下命令压缩:") print(f'python -c "import sys; sys.path.insert(0, r\'{os.path.dirname(os.path.abspath(__file__))}\'); from compress_ppt_videos import run; run(r\'{result["normalized_path"]}\')"') ``` ### Technical Analysis The documented workflow embeds an entire user message or user-controlled file path directly into Python source passed to `python -c`. Python raw strings do not provide safe quoting or escaping. They only change how backslashes are interpreted inside a string literal. An attacker can include quote and delimiter sequences that terminate the intended string literal. For example, content containing `''')` can terminate the triple-quoted user-message literal. A valid Unix filename may also contain a single quote, which can terminate the `r'...'` literals used for p ...[truncated 1855 chars]
Remediation
View remediation

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/download_ffmpeg.py:24
Finding

Remote FFmpeg Binaries Are Downloaded and Executed Without Integrity Verification

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/compress_ppt_videos.py:113
Finding

Automatic Unpinned Pillow Installation Modifies the Runtime Environment

Content
View full analysis
Remediation
View remediation
\ --hash=sha256: ``` 4. Install dependencies into a dedicated virtual environment rather than the active system or Agent interpreter. 5. Use `pip install --require-hashes` and restrict installation to an approved package index. 6. Present a clear missing-dependency error instead of silently modifying the environment. 7. If assisted setup is retained, require explicit user consent and display the package version, source, and target environment before installation. 8. Scan and periodically update pinned dependencies through a controlled review process. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/compress_ppt_videos.py:318
Finding

Unbounded PPTX Archive Extraction Enables Resource Exhaustion

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (19)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill instructs the agent to perform shell execution, read and write files, and potentially download ffmpeg over the network, but it declares no explicit tool scope or permission boundaries. That increases the chance an agent runtime will grant broader-than-necessary capabilities or execute the workflow without clear policy review, which is especially risky because the skill operates on user-supplied paths and can fetch binaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill does not prominently warn that it rewrites embedded media and creates a modified PPTX whose image quality, video quality, or playback fidelity may change. In practice this can cause silent integrity loss or user harm through unintended modification of important presentation assets, particularly when the agent is encouraged to run the workflow directly after path validation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The user-interaction section directs the agent with Chinese-only prompts and templates for collecting file paths. Because no opt-in or alternative language behavior is documented, this can force a specific language/locale on users, which matches the policy category for natural-language locale violations.

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

python
def check_ffmpeg(ffmpeg_path):
    """Verify that ffmpeg is accessible and working."""
    try:
        result = subprocess.run(
            [ffmpeg_path, '-version'],
            capture_output=True, text=True, timeout=10
        )

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Auto-installing Pillow is a real security concern because it introduces unexpected dependency installation and network activity into a file-processing skill. In an agent context, this can violate least surprise, bypass environment controls, and expose the host to supply-chain compromise or policy violations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The recommended run()/compress_pptx path can trigger pip installation implicitly, without an upfront warning or confirmation at the API boundary. In agent-driven use, that means a simple PPT compression request may unexpectedly perform package installation, which is materially more dangerous than the advertised behavior.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
96% confidence
Finding

This code automatically installs Pillow at runtime via pip when the dependency is missing, causing network access and package-management side effects during normal skill execution. That expands the trust boundary from local PPT compression to remote package retrieval and execution, which can be risky in restricted environments or if package sources are compromised.

Content

Scanner excerpt · scripts/compress_ppt_videos.py (reported line 121)May include surrounding context.

python
except ImportError:
        print("[INFO] Pillow not found. Installing...")
        try:
            result = subprocess.run(
                [sys.executable, '-m', 'pip', 'install', 'Pillow', '-q'],
                capture_output=True, text=True, timeout=120
            )

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

python
def get_video_info(ffprobe_path, video_path):
    """Get video file information using ffprobe."""
    try:
        result = subprocess.run(
            [
                ffprobe_path, '-v', 'quiet',
                '-print_format', 'json',

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · scripts/compress_ppt_videos.py (reported line 177)May include surrounding context.

python
# Build ffmpeg command
    cmd = [
        ffmpeg_path, '-y',        # Overwrite output without asking
        '-i', str(input_path),    # Input file
    ]

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

python
cmd.append(str(output_path))

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

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script fetches executable ffmpeg/ffprobe binaries from the network at runtime, which expands a local file-compression skill into a software bootstrapper. This creates supply-chain risk because the downloaded binaries are not pinned by version, hash, or signature, and the skill description claims ffmpeg is bundled, making the network behavior unexpected.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The code adds network-based installation logic that is not necessary for merely compressing a PPTX and therefore increases attack surface beyond the stated user task. Because it retrieves and installs executables automatically, a compromised upstream host, MITM in a weak trust environment, or unexpected content change could result in untrusted code being placed locally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The Windows path downloads a ZIP from the internet and extracts it directly into the script directory without validating archive contents. Untrusted archive extraction can enable path traversal or overwriting of local files if the archive is malicious or compromised, in addition to silently placing executables on disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The macOS branch downloads ZIP archives containing executables and extracts them into BIN_DIR without integrity verification or an explicit setup confirmation. Although the write target is narrower than the Windows case, it still silently installs executable files from the network into the local environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The Linux path downloads a tar.xz archive and calls tarfile.extractall on it directly into the script directory, which is a well-known unsafe pattern for path traversal and arbitrary file overwrite from crafted tar members. It also copies executables locally without integrity checks, compounding the supply-chain risk.

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

python
elif plat == 'darwin':
            print("  - Install via: brew install ffmpeg")
        elif plat == 'linux':
            print("  - Install via: sudo apt install ffmpeg  (Debian/Ubuntu)")
            print("  - Install via: sudo dnf install ffmpeg  (Fedora)")
            print("  - Install via: sudo pacman -S ffmpeg    (Arch)")
        sys.exit(1)

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

python
elif plat == 'darwin':
            print("  - Install via: brew install ffmpeg")
        elif plat == 'linux':
            print("  - Install via: sudo apt install ffmpeg  (Debian/Ubuntu)")
            print("  - Install via: sudo dnf install ffmpeg  (Fedora)")
            print("  - Install via: sudo pacman -S ffmpeg    (Arch)")
        sys.exit(1)

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

python
elif plat == 'darwin':
            print("  - Install via: brew install ffmpeg")
        elif plat == 'linux':
            print("  - Install via: sudo apt install ffmpeg  (Debian/Ubuntu)")
            print("  - Install via: sudo dnf install ffmpeg  (Fedora)")
            print("  - Install via: sudo pacman -S ffmpeg    (Arch)")
        sys.exit(1)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains multiple user-facing error messages, help text, and status output exclusively in Chinese. Because the skill does not offer user opt-in for language selection and does not document that it is intentionally limited to a Chinese-speaking context, it violates the language/locale policy for natural-language behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.