{"id":"CVE-2026-40334","aliases":["CVE-2026-40334"],"related":[],"kind":"vulnerability","state":"published","title":"libgphoto2 missing null termination in ptp_unpack_Canon_FE() filename buffer in ptp-pack.c","summary":"libgphoto2 is a camera access and control library. In versions up to and including 2.5.33, a missing null terminator exists in ptp_unpack_Canon_FE() in camlibs/ptp2/ptp-pack.c (line 1377). The function copies a filename into a 13-byte buffer using strncpy without explicitly null-terminating the result. If the source data is exactly 13 bytes with no null terminator, the buffer is left unterminated, leading to out-of-bounds reads in any subsequent string operation. Commit 259fc7d3bfe534ce4b114c464f55b448670ab873 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"libgphoto2 is a camera access and control library. In versions up to and including 2.5.33, a missing null terminator exists in ptp_unpack_Canon_FE() in camlibs/ptp2/ptp-pack.c (line 1377). The function copies a filename into a 13-byte buffer using strncpy without explicitly null-terminating the result. If the source data is exactly 13 bytes with no null terminator, the buffer is left unterminated, leading to out-of-bounds reads in any subsequent string operation. Commit 259fc7d3bfe534ce4b114c464f55b448670ab873 patches the issue.","source":"cvelist"},{"lang":"es","text":"libgphoto2 es una biblioteca de acceso y control de cámaras. En versiones hasta la 2.5.33 inclusive, existe un terminador nulo faltante en ptp_unpack_Canon_FE() en camlibs/ptp2/ptp-pack.c (línea 1377). La función copia un nombre de archivo en un búfer de 13 bytes usando strncpy sin terminar explícitamente el resultado con un nulo. Si los datos de origen tienen exactamente 13 bytes sin un terminador nulo, el búfer queda sin terminar, lo que lleva a lecturas fuera de límites en cualquier operación de cadena posterior. El commit 259fc7d3bfe534ce4b114c464f55b448670ab873 corrige el problema.","source":"nvd"}],"published":"2026-04-17T23:16:38.751Z","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:L/I:N/A:L","score":3.5,"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:L/I:N/A:L","score":3.5,"rating":"LOW"}],"cwes":["CWE-170"],"affected":[{"ranges":[{"version":"<= 2.5.33","status":"affected"}],"vendor":"gphoto","product":"libgphoto2","source":"cvelist"}],"references":[{"url":"https://github.com/gphoto/libgphoto2/security/advisories/GHSA-ph87-cc3j-c6hm","tags":["x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gphoto/libgphoto2/commit/259fc7d3bfe534ce4b114c464f55b448670ab873","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:27:56.209Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40334","url":"https://www.cve.org/CVERecord?id=CVE-2026-40334","licence":"CVE Terms of Use","modified":"2026-04-20T13:36:05.703Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40334","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40334","licence":"Public domain","modified":"2026-10-26T22:10:00.163Z"}],"updatedAt":"2026-11-25T22:59:18.981Z","epss":{"score":0.00194,"percentile":0.096,"date":"2026-12-01T12:00:22.000Z"}}