CVE-2026-40338: CWE-125: Out-of-bounds Read in gphoto libgphoto2
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.
AI Analysis
Technical Summary
libgphoto2, a camera access and control library, contains an out-of-bounds read vulnerability (CWE-125) in versions up to 2.5.33. The vulnerability is in the ptp_unpack_Sony_DPD() function within camlibs/ptp2/ptp-pack.c at line 856, where a 2-byte enumeration count is read without checking if sufficient data remains in the buffer. This differs from the standard ptp_unpack_DPD() function, which includes the necessary boundary check. The issue was addressed in commit 3b9f9696be76ae51dca983d9dd8ce586a2561845. The CVSS 3.1 base score is 5.2 (medium severity), reflecting a local attack vector with low complexity and no privileges or user interaction required, impacting confidentiality and availability.
Potential Impact
Successful exploitation could allow an attacker with local access to cause an out-of-bounds read, potentially leading to information disclosure or application instability. The vulnerability does not affect integrity and requires local access to the device. There are no known exploits in the wild at this time.
Mitigation Recommendations
A code fix has been committed to address this vulnerability. However, there is no official patch release or vendor advisory confirming the availability of a fix. Users should monitor the official libgphoto2 project for updated releases that include this fix and apply them once available. Until then, cautious use of affected versions is advised. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance.
CVE-2026-40338: CWE-125: Out-of-bounds Read in gphoto libgphoto2
Description
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.
CVSS v3.1
Score 5.2medium
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
libgphoto2, a camera access and control library, contains an out-of-bounds read vulnerability (CWE-125) in versions up to 2.5.33. The vulnerability is in the ptp_unpack_Sony_DPD() function within camlibs/ptp2/ptp-pack.c at line 856, where a 2-byte enumeration count is read without checking if sufficient data remains in the buffer. This differs from the standard ptp_unpack_DPD() function, which includes the necessary boundary check. The issue was addressed in commit 3b9f9696be76ae51dca983d9dd8ce586a2561845. The CVSS 3.1 base score is 5.2 (medium severity), reflecting a local attack vector with low complexity and no privileges or user interaction required, impacting confidentiality and availability.
Potential Impact
Successful exploitation could allow an attacker with local access to cause an out-of-bounds read, potentially leading to information disclosure or application instability. The vulnerability does not affect integrity and requires local access to the device. There are no known exploits in the wild at this time.
Mitigation Recommendations
A code fix has been committed to address this vulnerability. However, there is no official patch release or vendor advisory confirming the availability of a fix. Users should monitor the official libgphoto2 project for updated releases that include this fix and apply them once available. Until then, cautious use of affected versions is advised. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-10T22:50:01.358Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69e389f6bdfbbecc59765158
Added to database: 4/18/2026, 1:41:10 PM
Last enriched: 4/26/2026, 2:39:47 AM
Last updated: 6/2/2026, 5:58:45 AM
Views: 118
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.