CVE-2026-40341
LOWAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker connects malicious USB device
-
DeliveryDevice presents itself as camera
-
ExploitSystem initiates device enumeration
-
Installlibgphoto2 parses PTP descriptors
-
C2Calls ptp_unpack_EOS_FocusInfoEx with crafted data
-
ExecuteOut-of-bounds read occurs
-
ImpactDenial of service (crash)
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Buffer over-read prevention
|
| Exploitation Conditions | Physical USB access is required; the attacker must connect a malicious USB device or camera to a system where libgphoto2 is installed and actively enumerating devices. Exploitation occurs specifically during device enumeration or initialization when libgphoto2 processes Canon EOS-specific PTP vendor extensions. Systems that do not use libgphoto2 (or do not enumerate camera devices) are not vulnerable. Non-Canon cameras or devices that do not respond with EOS PTP extension packets may not trigger the vulnerability, though any device sending specially-crafted PTP packets could potentially cause the crash. No remote exploitation is possible; network-based attackers cannot trigger this vulnerability. |
| Impact | The CVSS score of 3.5 reflects low real-world urgency: attack vector is physical (AV:P, requiring local physical USB access), complexity is low, and no authentication is needed. However, this rating underestimates practical risk in targeted scenarios. The vulnerability enables denial of service against any application linking libgphoto2 (including GNOME Photos, digiKam, and command-line tools) on systems where untrusted USB devices can be connected. The out-of-bounds read could theoretically enable information disclosure if adjacent memory contains sensitive data, though the primary impact is denial of service (availability). No active exploitation is confirmed, and no POC is publicly identified. The lack of workarounds combined with the simplicity of the exploit (plug in malicious device) suggests moderate priority for systems in environments where untrusted USB devices are a realistic threat (schools, kiosks, public workstations). For isolated desktop systems or servers without USB camera functionality, priority is minimal. |
| Exploit ScenarioDerived | An attacker connects a specially-crafted USB device (or modified camera firmware) that responds with malformed Canon EOS PTP extension packets to a system running a libgphoto2-dependent application. When the application enumerates connected devices, libgphoto2 invokes ptp_unpack_EOS_FocusInfoEx, which reads beyond buffer boundaries, crashing the application. This could be leveraged to disrupt workflows on shared systems or kiosks where USB devices are regularly plugged in. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 18, 2026
Out-of-bounds read in libgphoto2 versions up to 2.5.33 allows local attackers with physical USB access to crash the library via malformed PTP protocol data from untrusted camera devices, affecting applications using libgphoto2 for camera enumeration and control on desktop systems.
RemediationAI
Update libgphoto2 to version 2.5.34 or later. On Debian/Ubuntu systems, run 'apt-get update && apt-get upgrade libgphoto2-6' or equivalent. On Fedora/RHEL, use 'dnf upgrade libgphoto2'. Verify the update includes commit c385b34af260595dfbb5f9329526be5158985987 by checking the commit log. Applications statically linked against libgphoto2 must be recompiled against the patched library version. If immediate patching is impossible in constrained environments, restrict physical USB access or disable camera enumeration at the application level (e.g., in GNOME Photos, remove the 'Camera' datasource plugin or uninstall libgphoto2-based tools); note that this completely disables camera functionality and is only suitable as temporary mitigation. Review GitHub Security Advisory GHSA-vjx3-gjp6-r2g2 for distribution-specific patch availability.
Affected ProductsAI
libgphoto2 versions 2.5.33 and earlier are affected. This includes the library itself (CPE: purl:pkg:deb/debian/libgphoto2; purl:pkg:rpm/fedora/libgphoto2) and all applications statically or dynamically linked against libgphoto2, including GNOME Photos, digiKam, Gphoto2 command-line utility, and other camera-management tools. Affected distributions include Debian, Ubuntu (packaged as libgphoto2-6 and libgphoto2-6-dev), Fedora, and Red Hat systems. The fix is available in upstream commit c385b34af260595dfbb5f9329526be5158985987 and should be present in libgphoto2 version 2.5.34 or later.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
libgphoto2 is a userspace library enabling camera communication via the Picture Transfer Protocol (PTP) and USB protocols. The vulnerability resides in the ptp_unpack_EOS_FocusInfoEx function, which parses Canon EOS-specific PTP extension data without proper bounds validation (CWE-126: Out-of-bounds Read). When a malicious or malfunctioning USB device presents crafted PTP protocol packets, the function reads past allocated buffer boundaries, triggering a denial-of-service condition. The vulnerability is triggered during device initialization or enumeration when libgphoto2 processes vendor-specific PTP packets.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
Primary rating from Vendor (github) · only source for this CVE.
CVSS VectorVendor: github
DescriptionCVE.org
libgphoto2 is a camera access and control library. In versions up to and including 2.5.33, an out of bound read in ptp_unpack_EOS_FocusInfoEx could be used to crash libgphoto2 when processing input from untrusted USB devices. Commit c385b34af260595dfbb5f9329526be5158985987 contains a patch. No known workarounds are available.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB