Skip to content

CVE-2026-40340 libgphoto2 has OOB read in ptp_unpack_OI() in ptp-pack.c via malicious PTP ObjectInfo response

MediumCVSS 6.1 EPSS 0.23%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: partial
Technology
UbuntuDebianRed Hat

Description

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.

Upgrade path

11 packages: 4 fixed, 6 with no fix yet.

PackageAffectedFixed inStatus
debian/libgphoto2(Debian 12) = 2.5.30-1; = 2.5.31-1; = 2.5.31-2; = 2.5.31-2.1 +8 more No fix listed No fix yet
debian/libgphoto2(Debian 13) = 2.5.31-4; = 2.5.32-1; = 2.5.33-1; = 2.5.34-1 +2 more No fix listed No fix yet
redhat/libgphoto2(Red Hat enterprise_linux 10) All versions No fix listed No fix yet
redhat/libgphoto2(Red Hat enterprise_linux 8) All versions No fix listed No fix yet
redhat/libgphoto2(Red Hat enterprise_linux 9) All versions No fix listed No fix yet
redhat/libgphoto2(Red Hat rhel_els 7) All versions No fix listed No fix yet
debian/libgphoto2(Debian 14) < 2.5.34-1; = 2.5.31-4; = 2.5.32-1; = 2.5.33-1 2.5.34-1 Fixed
ubuntu/libgphoto2(Ubuntu 22.04) < 2.5.27-1ubuntu0.1 2.5.27-1ubuntu0.1 Fixed
ubuntu/libgphoto2(Ubuntu 24.04) < 2.5.31-2.1ubuntu1.1 2.5.31-2.1ubuntu1.1 Fixed
ubuntu/libgphoto2(Ubuntu 26.04) < 2.5.33-1ubuntu1.1 2.5.33-1ubuntu1.1 Fixed
gphoto libgphoto2 = <= 2.5.33 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
gphoto libgphoto2 = <= 2.5.33 No fix listed
debian/libgphoto2(Debian:12) All versions No fix listed
debian/libgphoto2(Debian:12) = 2.5.30-1 No fix listed
debian/libgphoto2(Debian:12) = 2.5.31-1 No fix listed
debian/libgphoto2(Debian:12) = 2.5.31-2 No fix listed
debian/libgphoto2(Debian:12) = 2.5.31-2.1 No fix listed
debian/libgphoto2(Debian:12) = 2.5.31-2.1~exp1 No fix listed
debian/libgphoto2(Debian:12) = 2.5.31-3 No fix listed
debian/libgphoto2(Debian:12) = 2.5.31-4 No fix listed
debian/libgphoto2(Debian:12) = 2.5.32-1 No fix listed
debian/libgphoto2(Debian:12) = 2.5.33-1 No fix listed
debian/libgphoto2(Debian:12) = 2.5.34-1 No fix listed
debian/libgphoto2(Debian:12) = 2.5.34-2 No fix listed
debian/libgphoto2(Debian:13) All versions No fix listed
debian/libgphoto2(Debian:13) = 2.5.31-4 No fix listed
debian/libgphoto2(Debian:13) = 2.5.32-1 No fix listed
debian/libgphoto2(Debian:13) = 2.5.33-1 No fix listed
debian/libgphoto2(Debian:13) = 2.5.34-1 No fix listed
debian/libgphoto2(Debian:13) = 2.5.34-2 No fix listed
debian/libgphoto2(Debian:14) < 2.5.34-1 2.5.34-1
debian/libgphoto2(Debian:14) = 2.5.31-4 No fix listed
debian/libgphoto2(Debian:14) = 2.5.32-1 No fix listed
debian/libgphoto2(Debian:14) = 2.5.33-1 No fix listed
redhat/libgphoto2(Red Hat:enterprise_linux:10) All versions No fix listed
redhat/libgphoto2(Red Hat:rhel_els:6) All versions No fix listed
Show 6 more
ProductAffected versionsFixed in
redhat/libgphoto2(Red Hat:rhel_els:7) All versions No fix listed
redhat/libgphoto2(Red Hat:enterprise_linux:8) All versions No fix listed
redhat/libgphoto2(Red Hat:enterprise_linux:9) All versions No fix listed
ubuntu/libgphoto2(Ubuntu:22.04) < 2.5.27-1ubuntu0.1 2.5.27-1ubuntu0.1
ubuntu/libgphoto2(Ubuntu:24.04) < 2.5.31-2.1ubuntu1.1 2.5.31-2.1ubuntu1.1
ubuntu/libgphoto2(Ubuntu:26.04) < 2.5.33-1ubuntu1.1 2.5.33-1ubuntu1.1

References