Back to skill

Security audit

3mf Print Editor

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated 3MF editing purpose, but its bundled helper extracts user-supplied 3MF zip archives without explicit containment or size limits.

Install only if you are comfortable reviewing or hardening the archive extraction path. Use it on trusted 3MF files, work in an isolated directory or virtual environment, avoid overwriting existing outputs, and prefer pinned dependencies if you plan repeated use.

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)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/mesh_tools.py:31
Finding

Unrestricted Extraction of User-Controlled 3MF Archives

Content
View full analysis
Path: """Extract a .3mf (zip) to dest_dir/extracted and return that path.""" dest_dir = Path(dest_dir) out = dest_dir / "extracted" if out.exists(): shutil.rmtree(out) out.mkdir(parents=True) with zipfile.ZipFile(archive_path) as z: z.extractall(out) return out ``` ### Technical Analysis A 3MF file is a ZIP archive and may be supplied by an untrusted user. The function passes every archive member directly to `ZipFile.extractall()` without independently validating: - Absolute or traversal-oriented member paths - Whether the resolved extraction target remains under `out` - Archive member types and platform-specific path semantics - The number of archive entries - Individual or total uncompressed sizes - Compression ratios - Duplicate or conflicting member names The absence of explicit containment checks creates a path-traversal risk on runtimes or archive path variants for which extraction sanitization is incomplete or bypassable. Even where the Python runtime normalizes common `../` entries, the function still relies implicitly on runtime-specific behavior rather than enforcing its own security boundary. The lack of resource limits also permits ZIP-bomb-style denial of service. A small archive can declare highly compressed entries that expand to a very large size, exhausting disk space, memory, or processing time. The function additionally removes an existing `dest_dir/extracted` tree recursively. Although the path is deterministically appended with `extracted`, callers must still ensure that `dest_dir` is trusted and that the resulting path cannot be redirected through unsafe filesystem objects. ### Attack Path 1. An attacker prov ...[truncated 1283 chars]
Remediation
View remediation
Path: root = root.resolve() member = Path(member_name) if member.is_absolute() or ".." in member.parts: raise ValueError(f"unsafe archive member: {member_name}") destination = (root / member).resolve() if destination != root and root not in destination.parents: raise ValueError(f"archive member escapes extraction root: {member_name}") return destination ``` All entries should be validated before any entry is written. Declared size checks should also be supplemented with streaming byte limits because archive metadata may be deceptive. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:40
Finding

Unpinned Third-Party Packages Installed at Runtime

Content
View full analysis
Remediation
View remediation
" .venv/bin/python -m pip install \ --require-hashes \ --index-url https://pypi.org/simple \ -r requirements.lock ``` The lockfile should contain exact versions and SHA-256 hashes for every direct and transitive dependency used on each supported platform. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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
Findings (3)

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 · references/3mf-structure.md (reported line 37)May include surrounding context.

xml
<model unit="millimeter" ... xmlns:p="...production/2015/06" requiredextensions="p">
 <metadata name="Application">BambuStudio-...</metadata>
 <!-- more <metadata> for Title/Designer/CreationDate/etc -->
 <resources>
  <object id="2" type="model">
   <components>

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill gives detailed instructions to extract, modify, and repackage .3mf files, including writing new object files and producing edited output, but it declares no explicit tool scope or allowed-tools restrictions. In an agent environment, that mismatch can let the skill induce file-write operations beyond a narrowly intended boundary, increasing the risk of unauthorized modification of local files if the agent applies the guidance automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This markdown file includes guidance to serialize edited mesh data back into the same project file structure, which can affect user data and project integrity. The section explains how to perform the write but does not include any warning about backing up files, avoiding overwrite of originals, or the risk of corrupting 3MF project structure if done incorrectly.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.