Back to skill

Security audit

Snapmaker U1

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches a Snapmaker printer-control purpose, but it includes an under-documented raw G-code command path that can directly control physical printer behavior.

Review this skill before installing. It can monitor and control a Snapmaker printer, but the included script has a raw G-code command that could move hardware, heat components, invoke printer macros, or otherwise change printer state if an agent calls it. Install only if you are comfortable with that level of device control, and prefer removing or restricting the gcode command and adding explicit confirmation for cancel or other state-changing operations.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/snapmaker.py:428
Finding

Undocumented Arbitrary G-code Execution Exceeds the Skill's Declared Privileges

Content
View full analysis
2: return cmd_gcode(" ".join(sys.argv[2:])) ``` ### Technical Analysis The command-line handler accepts arbitrary text following the `gcode` argument, joins it without validation, serializes it as the `script` property, and submits it directly to Moonraker's `/printer/gcode/script` endpoint. No command allowlist, parameter validation, safety boundary, authorization check, or interactive confirmation is applied. The capability is also absent from `SKILL.md`, which advertises status inspection, temperature and filament monitoring, and limited print controls such as pause, resume, and cancel. Arbitrary G-code execution grants substantially broader control than those declared operations and violates least-privilege expectations. The ultimate effect depends on the G-code commands and Klipper macros installed on the target printer. Commands may control heaters, move toolheads, alter printer state, or invoke privileged macros exposed by the printer configuration. ### Attack Path 1. An attacker, untrusted caller, or manipulated Agent gains the ability to invoke the Skill's command-line script. 2. The caller supplies an unsafe printer command through the undocumented interface: ```bash scripts/snapmaker.py gcode "ATTACKER_CONTROLLED_COMMAND" ``` 3. `main()` joins all remaining command-line arguments into a single unrestricted command string. 4. `cmd_gcode()` pl ...[truncated 941 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description says the skill is for status, temperatures, progress, and basic print controls, but the analyzed behavior indicates additional capabilities such as listing files, sending arbitrary G-code, and reading detailed RFID/sensor data. This mismatch is dangerous because reviewers and users may authorize the skill under a narrower trust model than the implementation actually requires, enabling unexpected device control or data access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documented interface explicitly advertises a gcode <CMD> operation, which grants arbitrary command execution on the printer controller rather than limiting actions to status checks and basic pause/resume/cancel controls described in the skill metadata. In a Moonraker/Klipper environment, arbitrary G-code can change temperatures, move axes, disable safeguards, or alter printer state, making this a materially broader and more dangerous capability than declared.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The cmd_gcode function takes user-supplied input, concatenates it into a script payload, and submits it directly to Moonraker's /printer/gcode/script endpoint with no validation or restriction. Because G-code is effectively a device control language, this enables arbitrary physical actions on the printer, including unsafe heating, movement, and configuration changes, which is especially dangerous given the skill is presented as a basic monitoring/control tool.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents use of environment variables and local configuration but does not declare an explicit tool/permission scope. That creates ambiguity about what runtime capabilities the skill expects and weakens least-privilege controls, making it easier for an agent to access local environment data without clear review boundaries.

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 14)May include surrounding context.

Configuration

Create a config file at ~/clawd/config/snapmaker.json:

json
{
  "ip": "192.168.x.x",

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation exposes a cancel command for active prints without warning that cancellation can waste material, interrupt jobs irreversibly, or potentially leave hardware in an unexpected state. In a printer-control skill, undocumented destructive actions raise the risk of accidental operational disruption from a casual or ambiguous user request.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.