CVE-2026-35163 in OctoPrint
Summary
by MITRE • 08/21/2026
OctoPrint provides a web interface for controlling consumer 3D printers. Prior to 1.11.8 and 2.0.0rc3, Suppressed Command notification popups use PNotify rendering for printer-controlled payload.command and payload.message values in src/octoprint/static/js/app/viewmodels/terminal.js without HTML escaping. An attacker who convinces a victim to print a crafted file can inject HTML and JavaScript into the notification, disrupt prints, read information available to the victim including sensitive settings when permitted, or perform actions in the victim's OctoPrint session. This issue is fixed in versions 1.11.8 and 2.0.0rc3.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 08/21/2026
OctoPrint serves as a widely adopted web-based interface for managing consumer-grade three-dimensional printers, allowing users to monitor print status, control motion axes, and manage file transfers remotely. The software architecture relies heavily on client-side JavaScript rendering to provide real-time feedback to the operator through various notification systems. A critical security flaw was identified within the Suppressed Command notification popups generated by the application prior to versions 1.11.8 and 2.0.0rc3. This vulnerability stems from a failure to properly sanitize user-controllable input before rendering it in the browser environment, specifically affecting how printer-controlled payloads are displayed to the end-user.
The technical root cause of this issue lies in the handling of payload.command and payload.message values within the terminal view model located at src/octoprint/static/js/app/viewmodels/terminal.js. When a print job is executed or modified via G-code commands, these command strings can be embedded into notification popups rendered by PNotify, a JavaScript library for displaying notifications. The application failed to apply HTML escaping to these specific fields before injecting them into the DOM. Consequently, if an attacker crafts a 3D printing file containing malicious script tags within its header or comment sections, and subsequently convinces a victim to print this file using their OctoPrint instance, the browser will interpret the injected content as executable code rather than plain text. This constitutes a classic Stored Cross-Site Scripting vulnerability where the malicious payload is stored on the server-side configuration of the printer job and executed in the context of the user's active session when they view the terminal output or notifications.
The operational impact of this vulnerability extends beyond simple script execution, posing significant risks to both data confidentiality and system integrity. An attacker leveraging this flaw can perform actions within the victim’s OctoPrint session with the same privileges as the authenticated user. This includes reading sensitive configuration settings that may reveal network topology details, API keys, or other security parameters if such permissions are granted to the user interface. Furthermore, the attacker can disrupt ongoing print jobs by manipulating the printer controls through injected JavaScript commands, potentially leading to physical damage of the 3D printer hardware or wasted materials due to uncontrolled motion axes. The ability to execute arbitrary code also allows for session hijacking scenarios where cookies and local storage data containing authentication tokens could be exfiltrated to a remote server controlled by the attacker.
This vulnerability aligns with Common Weakness Enumeration identifier CWE-79, which describes Improper Neutralization of Input During Web Page Generation known as Cross-site Scripting. In terms of threat modeling frameworks such as MITRE ATT&CK for Enterprise or ICS, this behavior corresponds to techniques involving Client-Side Injection and potentially Command and Control via legitimate application features. The attack vector requires social engineering elements where the victim must be persuaded to load a specific crafted file into their printer workflow, making it an indirect but high-impact exploitation path against IoT devices that are increasingly connected to local networks or the internet.
To mitigate this risk, users of OctoPrint must upgrade immediately to version 1.11.8 or later for the stable branch, or version 2.0.0rc3 and above for the release candidate track. These versions implement proper input sanitization by applying HTML escaping to payload.command and payload.message values before they are rendered in PNotify popups, thereby neutralizing any embedded script tags. Administrators should also enforce strict access controls on their OctoPrint instances, ensuring that only trusted users can upload files or execute commands. Additionally, implementing a Content Security Policy header within the web interface can provide an additional layer of defense by restricting the sources from which scripts are allowed to load and execute, further reducing the blast radius in case similar vulnerabilities exist elsewhere in the application logic. Regular auditing of uploaded G-code files for suspicious patterns is also recommended as part of a broader security hygiene strategy for connected manufacturing equipment.