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-40338: CWE-125: Out-of-bounds Read in gphoto libgphoto2

0
Medium
VulnerabilityCVE-2026-40338cvecve-2026-40338cwe-125
Published: Fri Apr 17 2026 (04/17/2026, 23:40:10 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 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

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

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/26/2026, 02:39:47 UTC

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.

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: 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 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