Skip to main content

CVE-2026-40333

MEDIUM
Out-of-bounds Read (CWE-125)
2026-04-18 security-advisories@github.com
6.1
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

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

  1. Recon
    Connect malicious PTP device to USB port
  2. Delivery
    System detects camera
  3. Exploit
    Camera import tool invokes libgphoto2
  4. Install
    Parse EOS event data
  5. C2
    Call vulnerable unpack function
  6. Execute
    Read beyond buffer boundary
  7. Impact
    Extract sensitive memory or trigger crash

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK

1 technique across 1 tactic: Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Physical access to a USB port on a machine with libgphoto2 installed is the primary requirement. The vulnerability is specifically triggered when processing EOS (Canon) camera event data via the ptp_unpack_EOS_events() function. Exploitation requires either a genuine Canon EOS camera connected to a hostile network (if network PTP is enabled, though uncommon), or more realistically, a malicious USB device impersonating an EOS camera. Automatic camera detection tools or explicit user invocation of gphoto2/camera import functions will trigger the vulnerable code path. The vulnerability cannot be exploited remotely over the network in typical libgphoto2 deployments (which use USB), nor does it require any authentication or special user privileges on the host system - only that the user (or a script) attempts to communicate with the connected camera device. Exploitation is blocked if: (1) libgphoto2 is not installed, (2) PTP2 camera support is compiled out or disabled, (3) the system has no USB camera device connected, or (4) access to camera devices is restricted by file permissions or SELinux/AppArmor policies.

Impact

CVSS 6.1 with physical attack vector (AV:P) substantially reduces real-world impact compared to network-based vulnerabilities with similar scores. The vulnerability requires local or physical access to a machine with libgphoto2 installed and an attached camera (or USB device impersonating one). CVSS impact shows high confidentiality (reading process memory) and high availability (crash via out-of-bounds read), but integrity is not affected (CWE-125 is read-only). The AC:L and PR:N/UI:N components indicate straightforward exploitation once physical access is obtained - no authentication or user interaction is needed beyond connecting the device. The patch is available via upstream commit, suggesting vendor acknowledgment and remediation. Real-world risk is moderate: applicable primarily to systems where users connect untrusted or compromised cameras, or in contexts where an attacker has local physical access to devices running libgphoto2 (e.g., kiosks, shared lab equipment). This is NOT a high-priority patch for enterprise environments where camera connectivity is managed or restricted, but becomes critical for photo management applications, camera docking stations, or forensic recovery tools that handle arbitrary camera devices.

Exploit ScenarioDerived

An attacker with physical access to a USB port crafts a malicious PTP device (using a Raspberry Pi, Arduino, or USB gadget) that impersonates a Canon EOS camera and sends specially crafted event structures. When a user connects this device to their Linux workstation running vulnerable libgphoto2, automatic camera detection triggers the library to parse the malicious events, causing out-of-bounds reads that leak heap or stack memory (potentially exposing API keys, credentials, or file data) or crash the camera access process.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.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 access to a connected camera to read sensitive information from process memory or cause denial of service via malformed EOS event data. Two functions in ptp-pack.c lack length validation, enabling unbounded buffer reads when processing camera events. The vulnerability requires physical device access and is not remotely exploitable, with no public exploit code identified at time of analysis.

RemediationAI

Patch to the commit 1817ecead20c2aafa7549dac9619fe38f47b2f53 or later, which adds length validation to the affected functions. Most Linux distributions should provide updated packages of libgphoto2 version 2.5.34 or later; check your distribution's package repositories. For applications bundling libgphoto2, rebuild against the patched library. Until patching is possible, mitigate by disabling automatic camera detection and limiting connections to trusted, known-good camera models via configuration whitelists, though this is cumbersome. Another compensating control is to run camera access tools in a sandboxed environment (container, VM, or AppArmor/SELinux profile) with read-only access to sensitive data, limiting the information disclosure impact. For systems where camera access is not required, uninstall libgphoto2 or disable the PTP2 camera support module. See GitHub security advisory GHSA-hq94-cp6h-3gjp and upstream commit 1817ecead20c2aafa7549dac9619fe38f47b2f53 for implementation details.

Affected ProductsAI

libgphoto2 versions up to and including 2.5.33 are affected. The vulnerability exists in the PTP2 camera library backend (camlibs/ptp2/ptp-pack.c), which is included in all standard libgphoto2 distributions. Any application linked against vulnerable libgphoto2, including gphoto2 command-line tool, graphical frontends, and media management software that uses libgphoto2 for camera support, inherits the vulnerability.

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 camera control library used to interface with digital cameras via the Picture Transfer Protocol (PTP). The vulnerability resides in camlibs/ptp2/ptp-pack.c, where functions handling EOS (Canon) camera events accept data pointers without corresponding length parameters. The root cause is CWE-125 (out-of-bounds read), a classic buffer over-read flaw. The affected functions are called from ptp_unpack_EOS_events(), which has access to the buffer size (xsize) but fails to pass this boundary information to the called functions. This design flaw creates an information disclosure and denial-of-service window: an attacker who controls a malicious PTP device (or spoofs one via USB) can craft event structures with fields that cause the parser to read beyond allocated memory boundaries.

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 6.1 MEDIUM
AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
SUSE MEDIUM
Red Hat 6.1 MEDIUM

Primary rating from Vendor (github).

CVSS VectorVendor: github

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

Lifecycle Timeline

2
Patch released
Apr 28, 2026 - 20:30 nvd
Patch available
CVE Published
Apr 18, 2026 - 00:16 nvd
MEDIUM 6.1

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 95% exploitable
Data Quality
7 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment Vendor 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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Medium
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
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.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed
SUSE Linux Enterprise Module for Desktop Applications 15 SP7 Fixed
SUSE Linux Enterprise Module for Package Hub 15 SP7 Fixed
SUSE Linux Enterprise Server 15 SP7 Fixed

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