motioneye

CVE-2026-31978

CVE-2026-31978 is a medium-severity path traversal vulnerability in motioneye (pip), affecting versions < 0.44.0. It is fixed in 0.44.0.

Key facts
CVSS score
6.5
Medium
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
motioneye
Fixed in
0.44.0
Disclosed
2026

Summary

Summary motionEye v0.43.1 (latest stable) is vulnerable to path traversal in the picture and movie API endpoints, like /picture/{id}/preview/{filename}. Neither the API handlers, nor the mediafiles.py functions like getmediapreview() check for .. sequences in the filename parameter, except getmediacontent() which does. This allows an authenticated user with normal (non-admin) privileges to read arbitrary files from the filesystem as the motionEye process user. Details The getmediacontent() function properly validates the path: But getmediapreview() does NOT: Similarly, delmediacontent() at line ~865 is also missing the check. This is a classic inconsistent fix pattern. The exploit requires %2F-encoded slashes (..%2F..%2F) which Tornado's URL router does NOT normalize, it passes the raw ../ through to os.path.join(). PoC Step 1: Authenticate as any user (normal or admin). Step 2: Compute the request signature. motionEye uses HMAC-style signatures for API authentication. The signature is SHA1("GET:<path>?username=<user>::<password>"). With the default empty admin password: Step 3: Send the request using curl --path-as-is (the --path-as-is flag is required, without it, curl normalizes ..%2F and collapses the traversal before sending): Step 4: The server returns the contents of /etc/passwd. Verified output: <img width="1743" height="410" alt="etcpasswd" src="https://github.com/user-attachments/assets/30ec85f7-4fe7-4d3b-ae23-1d02c3ecad64" /> Note on the signature value: The signature 8b387100a519c617bdd66fe629d14b05e09c6e0c is valid for the default empty admin password. If the admin password has been changed, regenerate the signature using the Python script above with the correct password passed as the key parameter. Impact An authenticated user (normal or admin) can read arbitrary files from the server, including: /etc/passwd, user enumeration /etc/motioneye/motion.conf, admin password hash, surveillance password in plaintext /etc/shadow, password hashes (if running as root, which is default in Docker) SSH keys, environment variables, and other sensitive configuration files Surveillance footage from other cameras

Impact

What is path traversal?

Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.

Severity and exposure

CVE-2026-31978 has a CVSS score of 6.5 (Medium). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (0.44.0). Upgrading removes the vulnerable code path.

Affected versions

pip

  • motioneye (< 0.44.0)

Security releases

  • motioneye → 0.44.0 (pip)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2026-31978 is reachable in your applications. Explore open-source security for your team.

See if CVE-2026-31978 is reachable in your applications. Get a demo

Already deployed Kodem? See CVE-2026-31978 in your environment

Remediation advice

Upgrade motioneye to 0.44.0 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2026-31978

What is CVE-2026-31978?

CVE-2026-31978 is a medium-severity path traversal vulnerability in motioneye (pip), affecting versions < 0.44.0. It is fixed in 0.44.0. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.

How severe is CVE-2026-31978?

CVE-2026-31978 has a CVSS score of 6.5 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which versions of motioneye are affected by CVE-2026-31978?

motioneye (pip) versions < 0.44.0 is affected.

Is there a fix for CVE-2026-31978?

Yes. CVE-2026-31978 is fixed in 0.44.0. Upgrade to this version or later.

Is CVE-2026-31978 exploitable, and should I be worried?

Whether CVE-2026-31978 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2026-31978 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2026-31978?

Upgrade motioneye to 0.44.0 or later.

Stop the waste.
Protect your environment with Kodem.