Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.0%top 99%

CVE-2026-40340: CWE-125: Out-of-bounds Read in gphoto libgphoto2

0
Medium
VulnerabilityCVE-2026-40340cvecve-2026-40340cwe-125
Published: Fri Apr 17 2026 (04/17/2026, 23:45:17 UTC)
Source: CVE Database V5
Vendor/Project: gphoto
Product: 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

Attack Vector
Physical
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
High
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/26/2026, 02:45:32 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses