CVE-2026-40336: libgphoto2 - Memory Leak
- Cve: CVE-2026-40336
- Name: libgphoto2 - Memory Leak
- Description: 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.
- Impact: Attackers can cause memory exhaustion leading to denial of service by triggering repeated property descriptor parsing.
- Remediation: Update to a version including commit 404ff02c75f3cb280196fc260a63c4d26cf1a8f6 or later.
- Vulnerability impact: denial_of_service
- Requirement type: none
- Labels source: projectdiscovery
- Severity: low
- Cvss score: 2.4
- Cvss vector: CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Epss score: 0.00188
- Epss percentile: 0.08403
- Assignee: [email protected]
- Published at: 2026-04-18T00:16:37Z
- Age in days: 220
- Modified at: 2026-10-26T21:10:00Z
- References total: 2
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2026-40336
- Nvd status: deferred
- Checked, none or zero: patch available, known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, products total, products, rejected by nvd
- Not known: vulnerability type, requirements, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-401 | Missing Release of Memory after Effective Lifetime |
References
| Url | Source | Tags |
|---|---|---|
| https://github.com/gphoto/libgphoto2/commit/404ff02c75f3cb280196fc260a63c4d26cf1a8f6 | nvd | |
| https://github.com/gphoto/libgphoto2/security/advisories/GHSA-g8xw-p5wj-mrxv | nvd |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| gphoto/libgphoto2 | commit, fix, security_advisory | yes | /v1/repositories/gphoto/libgphoto2 |
Index
- Checked, none or zero: repositories, repositories high signal, packages
Exploitation
- Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote, authentication required
- Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports, exposed hosts