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

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

- **Severity:** Medium 4.0 (`CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:L`)
- **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:** Yes
- **Published:** 18 Mar 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-x7mf-wrh9-r76c, PYSEC-2024-179

## 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 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2024-28237?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `octoprint` | PyPI | All versions | 1.10.0 |
| `octoprint` | PyPI | All versions | 1.10.0rc3 |
| `OctoPrint` | PyPI | All versions | 1.10.0rc3 |

Products: 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.

## Is CVE-2024-28237 being exploited?

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

## Other vulnerabilities in OctoPrint

- [CVE-2018-16710](https://insights.sbomify.com/CVE-2018-16710/): Information disclosure in n/a (critical 9.1)
- [CVE-2025-58180](https://insights.sbomify.com/CVE-2025-58180/): OctoPrint is Vulnerable to RCE Attacks via Unsanitized Filename in File Upload (high 7.5)
- [CVE-2022-1430](https://insights.sbomify.com/CVE-2022-1430/): Cross-site Scripting (XSS) - DOM in octoprint/octoprint (high 7.5)
- [CVE-2022-1432](https://insights.sbomify.com/CVE-2022-1432/): Cross-site Scripting (XSS) - Generic in octoprint/octoprint (high 7.5)
- [CVE-2024-32977](https://insights.sbomify.com/CVE-2024-32977/): OctoPrint Authentication Bypass via X-Forwarded-For Header when autologinLocal is enabled (high 7.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-28237 and fix it if it is affected.

What it is: 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.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-28237 exists.

Affected packages and fixed versions:
- octoprint (PyPI): affected all versions; fixed in 1.10.0
- octoprint (PyPI): affected all versions; fixed in 1.10.0rc3
- OctoPrint (PyPI): affected all versions; fixed in 1.10.0rc3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-28237/ (Markdown: https://insights.sbomify.com/CVE-2024-28237/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-28237
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-28237
- OSV: https://osv.dev/vulnerability/CVE-2024-28237

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-28237/
Summaries are generated and may contain mistakes; the official description above is the record.
