CVE Catalog

CVE-2026-40338

MediumCVSS 5.2
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.20%

9th percentile - higher than 9% of all known CVEs

Summary

libgphoto2 up to and including 2.5.33 has an out-of-bounds read in the PTP_DPFF_Enumeration case of ptp_unpack_Sony_DPD() in camlibs/ptp2/ptp-pack.c (line 856). The function reads a 2-byte enumeration count N via dtoh16o(data, *poffset) without verifying that 2 bytes remain in the buffer. The standard ptp_unpack_DPD() at line 704 has this check, confirming the Sony variant omitted it by oversight. Commit 3b9f9696be76ae51dca983d9dd8ce586a2561845 fixes the issue.

Risk Assessment

An out-of-bounds read can lead to application crashes or, in some cases, memory information disclosure. The risk is moderate because it requires processing specially crafted data from a device or file.

Recommendation

Update libgphoto2 to a version containing the fix (commit 3b9f9696be76ae51dca983d9dd8ce586a2561845 or later). Avoid processing untrusted files or data from unknown devices until updated.

Other vulnerabilities in libgphoto2

See all
Original NVD description (English source)

libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read in the PTP_DPFF_Enumeration case of `ptp_unpack_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (line 856). The function reads a 2-byte enumeration count N via `dtoh16o(data, *poffset)` without verifying that 2 bytes remain in the buffer. The standard `ptp_unpack_DPD()` at line 704 has this exact check, confirming the Sony variant omitted it by oversight. Commit 3b9f9696be76ae51dca983d9dd8ce586a2561845 fixes the issue.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS