CVE-2026-40336
Memory Leak in libgphoto2 ptp_unpack_Sony_DPD Function
Publication date: 2026-04-18
Last updated on: 2026-04-18
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| libgphoto2 | libgphoto2 | to 2.5.33 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-401 | The product does not sufficiently track and release allocated memory after it has been used, making the memory unavailable for reallocation and reuse. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a memory leak in the libgphoto2 library, specifically in the function ptp_unpack_Sony_DPD() found in the ptp-pack.c file. When processing a secondary enumeration list introduced in 2024 and later Sony cameras, the function allocates new memory without freeing previously allocated memory. This causes the original array and any string values it contains to be leaked every time a property descriptor is parsed.
How can this vulnerability impact me? :
The impact of this vulnerability is a memory leak, which means that the affected software will consume increasing amounts of memory over time when processing certain camera data. This can lead to degraded performance or potentially cause the application to crash or become unstable due to exhaustion of available memory.
What immediate steps should I take to mitigate this vulnerability?
To mitigate this vulnerability, update libgphoto2 to a version later than 2.5.33 where the issue is fixed (commit 404ff02c75f3cb280196fc260a63c4d26cf1a8f6). This will prevent the memory leak in the ptp_unpack_Sony_DPD() function.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The vulnerability in libgphoto2 is a memory leak that affects availability but does not impact confidentiality or integrity.
Given the CVSS score indicates no confidentiality or integrity impact, this vulnerability is unlikely to directly affect compliance with standards such as GDPR or HIPAA, which primarily focus on protecting personal data confidentiality and integrity.
However, since availability is affected, organizations with strict uptime or availability requirements might consider this relevant, but no direct compliance violation is indicated.