Skip to main content

CVE-2026-40341

LOW
Buffer Over-read (CWE-126)
2026-04-18 security-advisories@github.com
3.5
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Attacker connects malicious USB device
  2. Delivery
    Device presents itself as camera
  3. Exploit
    System initiates device enumeration
  4. Install
    libgphoto2 parses PTP descriptors
  5. C2
    Calls ptp_unpack_EOS_FocusInfoEx with crafted data
  6. Execute
    Out-of-bounds read occurs
  7. Impact
    Denial 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.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

Vendor (github) PRIMARY 3.5 LOW
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

Attack Vector
Physical
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
Low

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

EPSS Score
0.0%
Top 100% exploitable
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

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.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

18
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +18
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy