CVE-2026-40333 Memory corruption in libgphoto2
Out-of-bounds read in libgphoto2 allows attackers to cause crashes or disclose memory via crafted PTP data.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-40333?
CVE-2026-40333 is a medium-severity memory corruption vulnerability in libgphoto2, published on 17 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
libgphoto2 is a camera access and control library. In versions up to and including 2.5.33, two functions in camlibs/ptp2/ptp-pack.c accept a data pointer but no length parameter, performing unbounded reads. Their callers in ptp_unpack_EOS_events() have xsize available but never pass it, leaving both functions unable to validate reads against the actual buffer boundary. Commit 1817ecead20c2aafa7549dac9619fe38f47b2f53 patches the issue.
Weakness: CWE-125
Which versions are affected by CVE-2026-40333?
How do I fix CVE-2026-40333?
Apply the vendor's patch.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2026-40333 being exploited?
There is no known exploitation of CVE-2026-40333 in the wild and no public exploit code.
Sources
Also known as AZL-83021, DEBIAN-CVE-2026-40333, GHSA-hq94-cp6h-3gjp, UBUNTU-CVE-2026-40333.