Back to skill

Security audit

Bambu Lab Local Control

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real local Bambu printer-control skill, but it exposes high-impact printer commands with weak safeguards.

Review before installing. Use this only with a trusted local network and a printer you intend the agent to control. Treat raw G-code, stop, speed, and temperature commands as potentially disruptive physical actions, and prefer adding confirmations, G-code restrictions, and certificate pinning before routine 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
bambu.py:31
Finding
MQTT TLS Certificate Verification Is Disabled<![CDATA[ ## Vulnerability Details **File Location**: `bambu.py:31-32` **Vulnerability Type**: Improper TLS certificate validation **Risk Level**: High ### Vulnerable Code ```python def get_client(): client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2) client.username_pw_set("bblp", ACCESS_CODE) client.tls_set(cert_reqs=ssl.CERT_NONE) client.tls_insecure_set(True) return client ``` ### Technical Analysis The MQTT client enables TLS encryption but explicitly disables certificate verification through both `cert_reqs=ssl.CERT_NONE` and `tls_insecure_set(True)`. The application therefore cannot authenticate that the TLS endpoint is the intended Bambu Lab printer. The printer access code is configured as the MQTT password. A network-positioned attacker can impersonate the printer's MQTT service, terminate the unauthenticated TLS connection, and receive the credentials supplied by the client. The attacker can also return forged printer reports or observe commands sent by the user. This is particularly security-sensitive because the supported commands include temperature changes, print interruption, and arbitrary G-code. ### Attack Path 1. An attacker obtains a man-in-the-middle position on the printer's local network, such as through a compromised access point, ARP spoofing, or control of network infrastructure. 2. The attacker redirects traffic intended for the configured printer address to a malicious MQTT TLS endpoint. 3. The endpoint presents an arbitrary certificate. 4. The client accepts that certificate because certificate verification and hostname validation are disabled. 5. The client authenticates with username `bblp` and the configured printer access code, exposing the credential to the malicious endpoint. 6. The attacker uses the captured access code to connect to the actual printer or manipulates the active MQTT session. 7. The attacker may issue printer control commands, alter temperature settings, interrupt prints, inject ...[truncated 728 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove both insecure TLS settings: - Do not use `cert_reqs=ssl.CERT_NONE`. - Do not call `tls_insecure_set(True)`. 2. Configure the client to require certificate validation with `ssl.CERT_REQUIRED`. 3. Trust a documented printer CA certificate where the device platform supports it. 4. If the printer uses a self-signed certificate, implement explicit certificate or public-key fingerprint pinning and reject every unexpected certificate. 5. Verify the expected endpoint identity in addition to validating the certificate chain. 6. Fail closed when certificate validation fails; do not silently downgrade to insecure MQTT or unauthenticated TLS. 7. Clearly document any device-specific certificate provisioning or pin-rotation procedure. 8. As defense in depth, place the printer on an isolated trusted VLAN, restrict TCP port 8883 to approved controller hosts, and prevent untrusted clients from joining that network. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:17
Finding
Third-Party MQTT Dependency Is Installed Without Version or Integrity Pinning<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:17` **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash python3 -m venv ~/bambu-env source ~/bambu-env/bin/activate pip install paho-mqtt ``` ### Technical Analysis The documented installation command asks users to install the latest package available under the `paho-mqtt` name without pinning an audited version or verifying package hashes. Consequently, the code ultimately installed by users can change after this skill has been reviewed. If a future package release, package-index account, distribution channel, or dependency is compromised, users following the documentation could install attacker-controlled code. Unpinned installation can also introduce incompatible changes that alter security behavior. No evidence in the audited files establishes that the current `paho-mqtt` package is malicious. The issue is the absence of version and integrity controls in the installation process. ### Attack Path 1. An attacker compromises a future release channel, maintainer account, package-index entry, or relevant transitive dependency for the package. 2. A user follows the documented `pip install paho-mqtt` command after the compromised release becomes the default resolved version. 3. `pip` downloads and installs the attacker-controlled package because no reviewed version or cryptographic hash is required. 4. Malicious package code executes during installation or when `bambu.py` imports `paho.mqtt.client`. 5. The code runs with the privileges of the user operating the skill and can access files, environment variables, network resources, and printer credentials available to that account. ### Impact Assessment A successful supply-chain compromise could result in arbitrary Python code execution under the account installing or running the skill. The reachable scope may include: - Reading `config.json` and stealing the printer access ...[truncated 413 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Add a dependency manifest containing an explicitly reviewed `paho-mqtt` version. 2. Generate and verify cryptographic hashes for every distributed package, including transitive dependencies. 3. Install with hash enforcement, for example: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 4. Define the intended Python version and package index so resolution is reproducible. 5. Review release notes and security advisories before updating the pinned dependency. 6. Use an automated dependency-update process that runs tests and requires review before changing lock files or hashes. 7. Prefer an approved internal mirror or package repository where deployment requirements justify stronger supply-chain controls. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Missing User Warnings

High
Confidence
97% confidence
Finding
Arbitrary G-code is sent to the printer with no warning, validation, or restriction, despite direct physical effects on heaters, motors, fans, and motion systems. Because this is a hardware-control skill, unrestricted command injection is more dangerous than in a text-only tool: a single command can overheat components, move axes unexpectedly, or damage an in-progress job.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The documentation exposes commands that can directly alter printer state, including pausing, stopping, changing temperatures, changing speed, toggling hardware, and sending arbitrary G-code, without any warning about safety, material waste, interrupted jobs, or hardware risk. In a skill specifically designed for physical device control, omitting cautions and confirmation guidance increases the chance that users or downstream agents invoke disruptive or irreversible actions inappropriately.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The `print_control` path issues pause, resume, and especially stop commands immediately with no confirmation, dry-run, or warning. In an agentic or automated environment, this can cause unexpected interruption of prints, wasted material, and possible unsafe state transitions if commands are triggered accidentally or by prompt manipulation.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The skill exposes a raw `gcode` subcommand that forwards arbitrary user-supplied G-code directly to the printer. In the context of a printer-control skill, this expands the capability from bounded device management to unrestricted hardware control, enabling dangerous movements, heating, motor commands, or safety bypasses if invoked by a user, another tool, or an LLM agent without sufficient validation.

Natural-Language Policy Violations

Low
Confidence
97% confidence
Finding
The module description and subsequent user-facing strings are written in French, and the script does not provide any locale or language selection. This can violate language-choice policy when a skill forces a specific language without user opt-in or documented justification.

Static analysis

No suspicious patterns detected.