CVE-2026-40340: 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 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.
AI Analysis
Technical Summary
libgphoto2, a camera access and control library, contains an out-of-bounds read vulnerability (CWE-125) in the ptp_unpack_OI() function located in camlibs/ptp2/ptp-pack.c. The function validates that the length parameter is less than 48 but subsequently reads memory offsets 48 to 56, up to 9 bytes beyond the validated boundary, due to a Samsung Galaxy 64-bit object size detection heuristic. This can cause reading of unintended memory areas. The issue affects versions up to and including 2.5.33 and is addressed by commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33.
Potential Impact
The vulnerability allows an out-of-bounds read which can lead to unauthorized disclosure of memory contents, impacting confidentiality. The CVSS vector indicates no required privileges or user interaction, but the attack vector is physical (AV:P). The impact includes high confidentiality and availability impact but no integrity impact. There are no known exploits in the wild at this time.
Mitigation Recommendations
A fix for this vulnerability is available in the form of commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33. Users should upgrade libgphoto2 to a version that includes this commit or later. Since no official vendor advisory or patch link is provided, verify the fix status with the libgphoto2 project repository or maintainers. Patch status is not yet confirmed via a vendor advisory; check the vendor's resources for current remediation guidance.
CVE-2026-40340: 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 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 v3.1
Score 6.1medium
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 the ptp_unpack_OI() function located in camlibs/ptp2/ptp-pack.c. The function validates that the length parameter is less than 48 but subsequently reads memory offsets 48 to 56, up to 9 bytes beyond the validated boundary, due to a Samsung Galaxy 64-bit object size detection heuristic. This can cause reading of unintended memory areas. The issue affects versions up to and including 2.5.33 and is addressed by commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33.
Potential Impact
The vulnerability allows an out-of-bounds read which can lead to unauthorized disclosure of memory contents, impacting confidentiality. The CVSS vector indicates no required privileges or user interaction, but the attack vector is physical (AV:P). The impact includes high confidentiality and availability impact but no integrity impact. There are no known exploits in the wild at this time.
Mitigation Recommendations
A fix for this vulnerability is available in the form of commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33. Users should upgrade libgphoto2 to a version that includes this commit or later. Since no official vendor advisory or patch link is provided, verify the fix status with the libgphoto2 project repository or maintainers. Patch status is not yet confirmed via a vendor advisory; check the vendor's resources 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: 69e389f6bdfbbecc5976516c
Added to database: 4/18/2026, 1:41:10 PM
Last enriched: 4/26/2026, 2:45:32 AM
Last updated: 5/30/2026, 4:03:51 PM
Views: 123
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.