{"id":"CVE-2026-40336","aliases":["CVE-2026-40336"],"related":[],"kind":"vulnerability","state":"published","title":"libgphoto2 has memory leak in ptp_unpack_Sony_DPD() secondary enumeration list in ptp-pack.c","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"libgphoto2 es una biblioteca de acceso y control de cámaras. Las versiones hasta la 2.5.33 inclusive tienen una fuga de memoria en ’ptp_unpack_Sony_DPD()’ en ’camlibs/ptp2/ptp-pack.c’ (líneas 884-885). Al procesar una lista de enumeración secundaria (introducida en cámaras Sony de 2024 en adelante), la función sobrescribe dpd -> FORM.Enum.SupportedValue con una nueva llamada a calloc() sin liberar la asignación anterior de la línea 857. El array original y cualquier valor de cadena que contenga se filtran en cada análisis de descriptor de propiedad. El commit 404ff02c75f3cb280196fc260a63c4d26cf1a8f6 soluciona el problema.","source":"nvd"}],"published":"2026-04-17T23:27:42.868Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":2.4,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":2.4,"rating":"LOW"}],"cwes":["CWE-401"],"affected":[{"ranges":[{"version":"<= 2.5.33","status":"affected"}],"vendor":"gphoto","product":"libgphoto2","source":"cvelist"}],"references":[{"url":"https://github.com/gphoto/libgphoto2/security/advisories/GHSA-g8xw-p5wj-mrxv","tags":["x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gphoto/libgphoto2/commit/404ff02c75f3cb280196fc260a63c4d26cf1a8f6","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-20T16:14:43.782Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40336","url":"https://www.cve.org/CVERecord?id=CVE-2026-40336","licence":"CVE Terms of Use","modified":"2026-04-20T16:14:53.071Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40336","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40336","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:18.981Z","epss":{"score":0.00188,"percentile":0.0883,"date":"2026-12-01T12:00:22.000Z"}}