CVE-2026-40340
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
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| libgphoto2 | libgphoto2 | to 2.5.33 (inc) |
Helpful Resources
Exploitability
| 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.