Monitor vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
5.2

libgphoto2: Out-of-bounds read in Sony camera handling

CVE-2026-40339
Summary

Libgphoto2, a library that helps access and control cameras, has a bug in its code that could allow an attacker to access sensitive data. This vulnerability affects camera handling in libgphoto2 versions up to 2.5.33. To fix this issue, update to a newer version of the library, specifically version 2.5.34 or later.

Original title
libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read in `ptp_unpack_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (line 842). The function re...
Original description
libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read in `ptp_unpack_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (line 842). The function reads the FormFlag byte via `dtoh8o(data, *poffset)` without a prior bounds check. The standard `ptp_unpack_DPD()` at lines 686–687 correctly validates `*offset + sizeof(uint8_t) > dpdlen` before this same read, but the Sony variant omits this check entirely. Commit 09f8a940b1e418b5693f5c11e3016a1ad2cea62d fixes the issue.
nvd CVSS3.1 5.2
Vulnerability type
CWE-125 Out-of-bounds Read
Published: 18 Apr 2026 · Updated: 18 Apr 2026 · First seen: 18 Apr 2026