CVEfocus › CVE database › CVE-2026-40336

CVE-2026-40336libgphoto2 has memory leak in ptp_unpack_Sony_DPD() secondary enumeration list in…

CVSS 2.4 LowEPSS 0.2% (higher than 6% of CVEs)Published 2026-04-17Updated 2026-04-20Assigner: GitHub_M

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.

CWE-401

What to do

Fixed builds are available from Debian, Ubuntu: see the table below for the fixed version per release.

Debian, Red Hat have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

2Fixed
2Fix pending
10Under investigation
1Will not fix
2Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04libgphoto2Fixed2.5.33-1ubuntu1.1UBUNTU-CVE-2026-40336
Ubuntu 25.10libgphoto2Will not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2026-40336
Ubuntu 24.04libgphoto2Not affected
vulnerable_code_not_present
Ubuntu 22.04libgphoto2Not affected
vulnerable_code_not_present
Debian 14libgphoto2Fixed2.5.34-1DEBIAN-CVE-2026-40336
Debian 13libgphoto2Fix pendingDEBIAN-CVE-2026-40336
Debian 12libgphoto2Fix pendingDEBIAN-CVE-2026-40336
Red Hat Enterprise Linux 10libgphoto2Under investigation
Red Hat Enterprise Linux 10libgphoto2-develUnder investigation
Red Hat Enterprise Linux 9libgphoto2Under investigation
Red Hat Enterprise Linux 9libgphoto2-develUnder investigation
Red Hat Enterprise Linux 8libgphoto2Under investigation
Red Hat Enterprise Linux 8libgphoto2-develUnder investigation
Red Hat Enterprise Linux 7libgphoto2Under investigation
Red Hat Enterprise Linux 7libgphoto2-develUnder investigation
Red Hat Enterprise Linux 6libgphoto2Under investigation
Red Hat Enterprise Linux 6libgphoto2-develUnder investigation

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.