CVE-2026-31978 motionEye: Arbitrary File Read via Path Traversal in Picture/Movie Preview Endpoint

Medium 6.5 Published Updated

An authenticated user can read arbitrary files from the server via path traversal in motionEye's preview endpoints, exposing sensitive data.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-31978?

CVE-2026-31978 is a medium-severity path traversal vulnerability in motioneye-project motioneye, published on 24 Jun 2026. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

motionEye (mEye) is an online interface for motion software, which is a video surveillance program with motion detection. Versions prior to 0.44.0 are vulnerable to path traversal in the picture and movie API endpoints, suhc as /picture/{id}/preview/{filename}. Neither the API handlers, nor the mediafiles.py functions such as get_media_preview() check for .. sequences in the filename parameter, except for get_media_content(). This allows an authenticated user with normal (non-admin) privileges to read arbitrary files from the filesystem as the motionEye process user, such as: /etc/passwd, /etc/shadow, motionEye config files containing password hashes and plaintext passwords, SSH keys, and other cameras' surveillance footage. This issue has been fixed in version 0.44.0.

Weakness: CWE-284, CWE-22

Which versions are affected by CVE-2026-31978?

3 open source packages ship an affected version, including motioneye.

PackageAffectedFixed in
motioneye PyPIAll versions0.44.0
motioneye PyPIAll versions0.44.0
motioneye PyPIAll versions0.44.0

How do I fix CVE-2026-31978?

Upgrade motioneye to 0.44.0 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2026-31978 being exploited?

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

Sources

Also known as GHSA-g9fx-5r4h-pcw3, PYSEC-2026-2664.

Is CVE-2026-31978 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free