CVE-2026-40340
Published:April 17, 2026
Updated:April 23, 2026
libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read vulnerability in "ptp_unpack_OI()" in "camlibs/ptp2/ptp-pack.c" (lines 530–563). The function validates "len < PTP_oi_SequenceNumber" (i.e., len < 48) but subsequently accesses offsets 48–56, up to 9 bytes beyond the validated boundary, via the Samsung Galaxy 64-bit objectsize detection heuristic. Commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33 fixes the issue.
Affected Packages
https://github.com/gphoto/libgphoto2.git (GITHUB):
Affected version(s) >=v2.5.24 <2.5.34Fix Suggestion:
Update to version 2.5.34Related Resources (2)
Do you need more information?
Contact UsCVSS v4
Base Score:
5.2
Attack Vector
PHYSICAL
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
NONE
Vulnerable System Availability
HIGH
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
6.1
Attack Vector
PHYSICAL
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
HIGH
Weakness Type (CWE)
Out-of-bounds Read
EPSS
Base Score:
0.01