{"id":"CVE-2026-40338","aliases":["CVE-2026-40338"],"related":[],"kind":"vulnerability","state":"published","title":"libgphoto2 has OOB read in ptp_unpack_Sony_DPD() enumeration count parsing in ptp-pack.c","summary":"libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read in the PTP_DPFF_Enumeration case of `ptp_unpack_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (line 856). The function reads a 2-byte enumeration count N via `dtoh16o(data, *poffset)` without verifying that 2 bytes remain in the buffer. The standard `ptp_unpack_DPD()` at line 704 has this exact check, confirming the Sony variant omitted it by oversight. Commit 3b9f9696be76ae51dca983d9dd8ce586a2561845 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 an out-of-bounds read in the PTP_DPFF_Enumeration case of `ptp_unpack_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (line 856). The function reads a 2-byte enumeration count N via `dtoh16o(data, *poffset)` without verifying that 2 bytes remain in the buffer. The standard `ptp_unpack_DPD()` at line 704 has this exact check, confirming the Sony variant omitted it by oversight. Commit 3b9f9696be76ae51dca983d9dd8ce586a2561845 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 lectura fuera de límites en el caso PTP_DPFF_Enumeration de ’ptp_unpack_Sony_DPD()’ en ’camlibs/ptp2/ptp-pack.c’ (línea 856). La función lee un recuento de enumeración N de 2 bytes a través de ’dtoh16o(data, poffset)’ sin verificar que queden 2 bytes en el búfer. La función estándar ’ptp_unpack_DPD()’ en la línea 704 tiene esta verificación exacta, lo que confirma que la variante de Sony lo omitió por descuido. El commit 3b9f9696be76ae51dca983d9dd8ce586a2561845 soluciona el problema.","source":"nvd"}],"published":"2026-04-17T23:40:10.097Z","modified":"2026-10-26T22:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L","score":5.2,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L","score":5.2,"rating":"MEDIUM"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"version":"<= 2.5.33","status":"affected"}],"vendor":"gphoto","product":"libgphoto2","source":"cvelist"}],"references":[{"url":"https://github.com/gphoto/libgphoto2/security/advisories/GHSA-2hwp-w84q-27hf","tags":["x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gphoto/libgphoto2/commit/3b9f9696be76ae51dca983d9dd8ce586a2561845","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:13:41.644Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40338","url":"https://www.cve.org/CVERecord?id=CVE-2026-40338","licence":"CVE Terms of Use","modified":"2026-04-20T16:16:08.585Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40338","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40338","licence":"Public domain","modified":"2026-10-26T22:10:00.163Z"}],"updatedAt":"2026-11-25T22:59:18.982Z","epss":{"score":0.00205,"percentile":0.1112,"date":"2026-12-01T12:00:22.000Z"}}