{"id":"CVE-2026-40334","published":"2026-04-17T23:16:38Z","modified":"2026-04-20T13:36:05Z","title":"libgphoto2 missing null termination in ptp_unpack_Canon_FE() filename buffer in ptp-pack.c","vendor":"gphoto","product":"libgphoto2","tier":"tail","description":{"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":3.5,"severity":"LOW","version":"3.1","vector":"CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00194,"percentile":0.09317,"provenance":"source"},"cwes":[{"id":"CWE-170","name":"Improper Null Termination"}],"references":[{"url":"https://github.com/gphoto/libgphoto2/security/advisories/GHSA-ph87-cc3j-c6hm","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/gphoto/libgphoto2/commit/259fc7d3bfe534ce4b114c464f55b448670ab873","tags":["x_refsource_MISC"]}],"priority":{"score":4.3,"factors":[{"name":"EPSS percentile","points":1.86},{"name":"CVSS severity","points":2.45}]},"vendorSlug":"gphoto","affectedVersions":[{"vendor":"gphoto","product":"libgphoto2","versions":["<= 2.5.33"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-04-20T13:27:56.209528Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-23583","exploited":false,"provenance":"source"}}