gphoto libgphoto2 up to 2.5.33 camlibs/ptp2/ptp-pack.c ptp_unpack_Sony_DPD out-of-bounds

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
4.6$0-$5k2.41

Summaryinfo

A vulnerability was found in gphoto libgphoto2 up to 2.5.33. It has been classified as critical. This issue affects the function ptp_unpack_Sony_DPD of the file camlibs/ptp2/ptp-pack.c. This manipulation causes out-of-bounds. This vulnerability appears as CVE-2026-40339. It is feasible to perform the attack on the physical device. There is no available exploit. It is suggested to install a patch to address this issue.

Detailsinfo

A vulnerability was found in gphoto libgphoto2 up to 2.5.33. It has been declared as critical. Affected by this vulnerability is the function ptp_unpack_Sony_DPD of the file camlibs/ptp2/ptp-pack.c. The manipulation with an unknown input leads to a out-of-bounds vulnerability. The CWE definition for the vulnerability is CWE-125. The product reads data past the end, or before the beginning, of the intended buffer. As an impact it is known to affect confidentiality, integrity, and availability. The summary by CVE is:

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.

The advisory is shared at github.com. This vulnerability is known as CVE-2026-40339 since 04/11/2026. The exploitation appears to be easy. An attack has to be approached locally. The exploitation doesn't need any form of authentication. Technical details are known, but no exploit is available.

Applying the patch 09f8a940b1e418b5693f5c11e3016a1ad2cea62d is able to eliminate this problem. The bugfix is ready for download at github.com.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Productinfo

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔒
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 4.7
VulDB Meta Temp Score: 4.6

VulDB Base Score: 4.3
VulDB Temp Score: 4.1
VulDB Vector: 🔒
VulDB Reliability: 🔍

CNA Base Score: 5.2
CNA Vector (GitHub_M): 🔒

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍

Exploitinginfo

Class: Out-of-bounds
CWE: CWE-125 / CWE-119
CAPEC: 🔒
ATT&CK: 🔒

Physical: Yes
Local: Yes
Remote: No

Availability: 🔒
Status: Not defined
Price Prediction: 🔍
Current Price Estimation: 🔒

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Patch
Status: 🔍

0-Day Time: 🔒

Patch: 09f8a940b1e418b5693f5c11e3016a1ad2cea62d

Timelineinfo

04/11/2026 CVE reserved
04/18/2026 +7 days Advisory disclosed
04/18/2026 +0 days VulDB entry created
04/18/2026 +0 days VulDB entry last update

Sourcesinfo

Product: github.com

Advisory: GHSA-42cm-m9hc-r7q8
Status: Confirmed

CVE: CVE-2026-40339 (🔒)
GCVE (CVE): GCVE-0-2026-40339
GCVE (VulDB): GCVE-100-358153

Entryinfo

Created: 04/18/2026 08:56
Changes: 04/18/2026 08:56 (67)
Complete: 🔍
Cache ID: 216::103

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Might our Artificial Intelligence support you?

Check our Alexa App!