CVE-2026-40336 | gphoto libgphoto2 up to 2.5.33 camlibs/ptp2/ptp-pack.c ptp_unpack_Sony_DPD memory leak (GHSA-g8xw-p5wj-mrxv)
VulDBArchived Apr 18, 2026✓ Full text saved
A vulnerability was found in gphoto libgphoto2 up to 2.5.33 . It has been declared as problematic . This affects the function ptp_unpack_Sony_DPD of the file camlibs/ptp2/ptp-pack.c . Executing a manipulation can lead to memory leak. This vulnerability appears as CVE-2026-40336 . The physical device can be targeted for the attack. There is no available exploit. Applying a patch is advised to resolve this issue.
Full text archived locally
✦ AI Summary· Claude Sonnet
VDB-358169 · CVE-2026-40336 · GHSA-G8XW-P5WJ-MRXV
GPHOTO LIBGPHOTO2 UP TO 2.5.33 CAMLIBS/PTP2/PTP-PACK.C PTP_UNPACK_SONY_DPD MEMORY LEAK
HISTORYDIFFRELATEJSONXMLCTI
CVSS Meta Temp Score Current Exploit Price (≈) CTI Interest Score
2.3 $0-$5k 4.13
Summaryinfo
A vulnerability was found in gphoto libgphoto2 up to 2.5.33. It has been rated as problematic. This impacts the function ptp_unpack_Sony_DPD of the file camlibs/ptp2/ptp-pack.c. The manipulation leads to memory leak. This vulnerability is traded as CVE-2026-40336. It is possible to launch the attack on the physical device. There is no exploit available. It is suggested to install a patch to address this issue.
Detailsinfo
A vulnerability was found in gphoto libgphoto2 up to 2.5.33 and classified as problematic. This issue affects the function ptp_unpack_Sony_DPD of the file camlibs/ptp2/ptp-pack.c. The manipulation with an unknown input leads to a memory leak vulnerability. Using CWE to declare the problem leads to CWE-401. The product does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory. Impacted is availability. The summary by CVE is:
libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have a memory leak in `ptp_unpack_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (lines 884–885). When processing a secondary enumeration list (introduced in 2024+ Sony cameras), the function overwrites dpd->FORM.Enum.SupportedValue with a new calloc() without freeing the previous allocation from line 857. The original array and any string values it contains are leaked on every property descriptor parse. Commit 404ff02c75f3cb280196fc260a63c4d26cf1a8f6 fixes the issue.
The advisory is shared at github.com. The identification of this vulnerability is CVE-2026-40336 since 04/11/2026. The exploitation is known to be easy. An attack has to be approached locally. No form of authentication is needed for a successful exploitation. Technical details are known, but no exploit is available.
Applying the patch 404ff02c75f3cb280196fc260a63c4d26cf1a8f6 is able to eliminate this problem. The bugfix is ready for download at github.com.
Productinfo
Vendor
gphoto
Name
libgphoto2
Version
2.5.0
2.5.1
2.5.2
2.5.3
2.5.4
2.5.5
2.5.6
2.5.7
2.5.8
2.5.9
2.5.10
2.5.11
2.5.12
2.5.13
2.5.14
2.5.15
2.5.16
2.5.17
2.5.18
2.5.19
2.5.20
2.5.21
2.5.22
2.5.23
2.5.24
2.5.25
2.5.26
2.5.27
2.5.28
2.5.29
2.5.30
2.5.31
2.5.32
2.5.33
License
open-source
Website
Product: https://github.com/gphoto/libgphoto2/
CPE 2.3info
🔒
🔒
🔒
CPE 2.2info
🔒
🔒
🔒
CVSSv4info
VulDB Vector: 🔒
VulDB Reliability: 🔍
CVSSv3info
VulDB Meta Base Score: 2.4
VulDB Meta Temp Score: 2.3
VulDB Base Score: 2.4
VulDB Temp Score: 2.3
VulDB Vector: 🔒
VulDB Reliability: 🔍
CNA Base Score: 2.4
CNA Vector (GitHub_M): 🔒
CVSSv2info
Vector Complexity Authentication Confidentiality Integrity Availability
Unlock Unlock Unlock Unlock Unlock Unlock
Unlock Unlock Unlock Unlock Unlock Unlock
Unlock Unlock Unlock Unlock Unlock Unlock
VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍
Exploitinginfo
Class: Memory leak
CWE: CWE-401 / CWE-404
CAPEC: 🔒
ATT&CK: 🔒
Physical: Yes
Local: Yes
Remote: No
Availability: 🔒
Status: Not defined
Price Prediction: 🔍
Current Price Estimation: 🔒
0-Day Unlock Unlock Unlock Unlock
Today Unlock Unlock Unlock Unlock
Threat Intelligenceinfo
Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍
Countermeasuresinfo
Recommended: Patch
Status: 🔍
0-Day Time: 🔒
Patch: 404ff02c75f3cb280196fc260a63c4d26cf1a8f6
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-g8xw-p5wj-mrxv
Status: Confirmed
CVE: CVE-2026-40336 (🔒)
GCVE (CVE): GCVE-0-2026-40336
GCVE (VulDB): GCVE-100-358169
Entryinfo
Created: 04/18/2026 09:02
Changes: 04/18/2026 09:02 (67)
Complete: 🔍
Cache ID: 99:040:101
Discussion
No comments yet. Languages: en.
Please log in to comment.
◂ PreviousOverviewNext ▸