# CVE-2025-60787: motionEye vulnerable to RCE via unsanitized motion config parameter

> Authenticated administrators can execute arbitrary OS commands via unsanitized configuration parameters in MotionEye.

- **Severity:** High 7.2 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Oct 2025
- **Updated:** 5 Jul 2026
- **Also known as:** GHSA-j945-qm58-4gjx, PYSEC-2026-1680

## What is CVE-2025-60787?

CVE-2025-60787 is a high-severity command injection vulnerability in n/a, published on 3 Oct 2025. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

MotionEye v0.43.1b4 and before is vulnerable to OS Command Injection in configuration parameters such as image_file_name. Unsanitized user input is written to Motion configuration files, allowing remote authenticated attackers with admin access to achieve code execution when Motion is restarted.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command), CWE-20 (Improper Input Validation), CWE-116 (Improper Encoding or Escaping of Output)

## Which versions are affected by CVE-2025-60787?

3 open source packages ship an affected version, including motioneye. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `motioneye` | PyPI | All versions | 0.43.1b5 |
| `motioneye` | PyPI | All versions | 0.43.1b5 |
| `motioneye` | PyPI | All versions | 0.43.1b5 |

Products: Motioneye Project Motioneye.

## How do I fix CVE-2025-60787?

Upgrade motioneye to 0.43.1b5 or later.

## Is CVE-2025-60787 being exploited?

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

Public exploit code:

- PoC for CVE-2025-60787 - Authenticated RCE in motionEye for all versions up to 0.43.1b4 (included) (github_poc): https://github.com/gunzf0x/CVE-2025-60787
- https://github.com/lil0xplorer/CVE-2025-60787_PoC (github_poc): https://github.com/lil0xplorer/CVE-2025-60787_PoC
- Professional PoC for CVE-2025-60787: Remote Code Execution in MotionEye (<= 0.43.1b4). This exploit demonstrates an OS Command Injection vulnerability through client-side validation bypass, allowing attackers to execute arbitrary commands via configuration files. (github_poc): https://github.com/Rohitberiwala/CVE-2025-60787-MotionEye-RCE
- Remote Code Execution Vulnerability in MotionEye Frontend (CVE-2025-60787) (metasploit)
- CVE-2025-60787 Poc - RCE - MotionEye <= 0.43.1b4 (github_poc): https://github.com/prabhatverma47/CVE-2025-60787
- motionEye 0.43.1b4 - RCE (exploitdb)

## Other vulnerabilities in n/a

- [CVE-2022-25568](https://insights.sbomify.com/CVE-2022-25568/): MotionEye allows attackers to access sensitive information (high 7.5)
- [CVE-2021-44255](https://insights.sbomify.com/CVE-2021-44255/): Unrestricted Upload of File with Dangerous Type in motionEye (high 7.2)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-60787 and fix it if it is affected.

What it is: CVE-2025-60787 is a high-severity command injection vulnerability in n/a, published on 3 Oct 2025. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-60787 exists.

Affected packages and fixed versions:
- motioneye (PyPI): affected all versions; fixed in 0.43.1b5
- motioneye (PyPI): affected all versions; fixed in 0.43.1b5
- motioneye (PyPI): affected all versions; fixed in 0.43.1b5

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-2025-60787/ (Markdown: https://insights.sbomify.com/CVE-2025-60787/index.md)
```

## Sources

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

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