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

0
Medium
VulnerabilityCVE-2026-40339cvecve-2026-40339cwe-125
Published: Fri Apr 17 2026 (04/17/2026, 23:42:32 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 `ptp_unpack_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (line 842). The function reads the FormFlag byte via `dtoh8o(data, *poffset)` without a prior bounds check. The standard `ptp_unpack_DPD()` at lines 686–687 correctly validates `*offset + sizeof(uint8_t) > dpdlen` before this same read, but the Sony variant omits this check entirely. Commit 09f8a940b1e418b5693f5c11e3016a1ad2cea62d 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:42:44 UTC

Technical Analysis

libgphoto2, a camera access and control library, contains an out-of-bounds read vulnerability in versions up to 2.5.33 within the ptp_unpack_Sony_DPD() function in camlibs/ptp2/ptp-pack.c. The function reads the FormFlag byte without validating that the read is within the bounds of the data buffer, unlike the standard ptp_unpack_DPD() function which performs this check. This flaw can cause the application to read memory beyond the allocated buffer, potentially leading to information disclosure or application instability. The issue was corrected in commit 09f8a940b1e418b5693f5c11e3016a1ad2cea62d. The CVSS 3.1 base score is 5.2, reflecting a medium severity with network attack vector requiring no privileges or user interaction, impacting confidentiality and availability.

Potential Impact

The vulnerability allows an out-of-bounds read which can lead to partial disclosure of memory contents or cause application crashes, impacting confidentiality and availability. The CVSS score of 5.2 indicates a medium severity impact. There are no reports of exploitation in the wild. The attack vector is local (physical or logical access to the device running libgphoto2), and no privileges or user interaction are required.

Mitigation Recommendations

A fix for this vulnerability exists as a source code commit (09f8a940b1e418b5693f5c11e3016a1ad2cea62d) that adds the missing bounds check. However, no official patch release or vendor advisory has been provided to confirm patch availability. Users should monitor the official libgphoto2 project for updated releases containing this fix and apply them promptly. Until then, avoid processing untrusted Sony camera data with vulnerable versions of libgphoto2 to reduce risk. 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: 69e389f6bdfbbecc59765160

Added to database: 4/18/2026, 1:41:10 PM

Last enriched: 4/26/2026, 2:42:44 AM

Last updated: 6/2/2026, 10:08:50 AM

Views: 114

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