{"id":"CVE-2026-40340","aliases":["CVE-2026-40340"],"related":[],"kind":"vulnerability","state":"published","title":"libgphoto2 has OOB read in ptp_unpack_OI() in ptp-pack.c via malicious PTP ObjectInfo response","summary":"libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read vulnerability in `ptp_unpack_OI()` in `camlibs/ptp2/ptp-pack.c` (lines 530–563). The function validates `len < PTP_oi_SequenceNumber` (i.e., len < 48) but subsequently accesses offsets 48–56, up to 9 bytes beyond the validated boundary, via the Samsung Galaxy 64-bit objectsize detection heuristic. Commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33 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 vulnerability in `ptp_unpack_OI()` in `camlibs/ptp2/ptp-pack.c` (lines 530–563). The function validates `len < PTP_oi_SequenceNumber` (i.e., len < 48) but subsequently accesses offsets 48–56, up to 9 bytes beyond the validated boundary, via the Samsung Galaxy 64-bit objectsize detection heuristic. Commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33 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 vulnerabilidad de lectura fuera de límites en ’ptp_unpack_OI()’ en ’camlibs/ptp2/ptp-pack.c’ (líneas 530-563). La función valida ’len < PTP_oi_SequenceNumber’ (es decir, len menor que 48) pero posteriormente accede a los offsets 48-56, hasta 9 bytes más allá del límite validado, a través de la heurística de detección de tamaño de objeto de 64 bits de Samsung Galaxy. El commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33 soluciona el problema.","source":"nvd"}],"published":"2026-04-17T23:45:17.467Z","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:H/I:N/A:H","score":6.1,"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:H","score":6.1,"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-xfw3-xvjp-5wcv","tags":["x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gphoto/libgphoto2/commit/7c7f515bc88c3d0c4098ac965d313518e0ccbe33","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-20T13:29:33.955Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40340","url":"https://www.cve.org/CVERecord?id=CVE-2026-40340","licence":"CVE Terms of Use","modified":"2026-04-20T13:36:05.149Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40340","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40340","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:18.982Z","epss":{"score":0.00227,"percentile":0.14316,"date":"2026-12-01T12:00:22.000Z"}}