CVE-2026-40340
Received Received - Intake
Out-of-Bounds Read in libgphoto2 ptp_unpack_OI Function

Publication date: 2026-04-18

Last updated on: 2026-04-18

Assigner: GitHub, Inc.

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-18
Last Modified
2026-04-18
Generated
2026-05-07
AI Q&A
2026-04-18
EPSS Evaluated
2026-05-05
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
libgphoto2 libgphoto2 to 2.5.33 (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-125 The product reads data past the end, or before the beginning, of the intended buffer.
Attack-Flow Graph
AI Powered Q&A
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The provided information does not specify any direct impact of this vulnerability on compliance with common standards and regulations such as GDPR or HIPAA.


Can you explain this vulnerability to me?

This vulnerability exists in libgphoto2, a camera access and control library, in versions up to and including 2.5.33. It is an out-of-bounds read issue in the function ptp_unpack_OI() located in camlibs/ptp2/ptp-pack.c. The function checks if a length value is less than 48 but then reads data from offsets 48 to 56, which is up to 9 bytes beyond the validated boundary. This can cause the program to read memory it should not access.


How can this vulnerability impact me? :

The vulnerability has a CVSS v3.1 base score of 6.1, indicating a medium severity. It requires physical attack vector (AV:P) but has low attack complexity and no privileges or user interaction needed. The impact includes high confidentiality and availability impact, meaning an attacker could potentially read sensitive memory contents and cause denial of service or crash the application.


What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability, update libgphoto2 to a version later than 2.5.33 where the issue is fixed.

The vulnerability is fixed in the commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33, so applying this patch or upgrading to a version including this fix will address the problem.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart