CVE-2024-28237 OctoPrint XSS via the "Snapshot Test" feature in Classic Webcam plugin settings

Medium 4.0 Published Updated

Malicious admins can trigger XSS in victim admin browsers via crafted webcam snapshot URLs, allowing sensitive data access or print interruption.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-28237?

CVE-2024-28237 is a medium-severity cross-site scripting vulnerability in OctoPrint, published on 18 Mar 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

OctoPrint provides a web interface for controlling consumer 3D printers. OctoPrint versions up until and including 1.9.3 contain a vulnerability that allows malicious admins to configure or talk a victim with administrator rights into configuring a webcam snapshot URL which when tested through the "Test" button included in the web interface will execute JavaScript code in the victims browser when attempting to render the snapshot image. An attacker who successfully talked a victim with admin rights into performing a snapshot test with such a crafted URL could use this to retrieve or modify sensitive configuration settings, interrupt prints or otherwise interact with the OctoPrint instance in a malicious way. The vulnerability is patched in version 1.10.0rc3. OctoPrint administrators are strongly advised to thoroughly vet who has admin access to their installation and what settings they modify based on instructions by strangers.

Weakness: CWE-79

Which versions are affected by CVE-2024-28237?

3 open source packages ship an affected version, including octoprint and OctoPrint. It affects 1 product.

PackageAffectedFixed in
octoprint PyPIAll versions1.10.0
octoprint PyPIAll versions1.10.0rc3
OctoPrint PyPIAll versions1.10.0rc3

Products include Octoprint Octoprint.

How do I fix CVE-2024-28237?

Upgrade octoprint to a fixed version for your release line: 1.10.0 or 1.10.0rc3.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2024-28237 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-28237 exists.

Sources

Also known as GHSA-x7mf-wrh9-r76c, PYSEC-2024-179.

Is CVE-2024-28237 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free