# CVE-2026-40334: libgphoto2 missing null termination in ptp_unpack_Canon_FE() filename buffer in ptp-pack.c

- Severity: Low 3.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 9% of CVEs (2026-12-01)
- Published: 2026-04-17T23:16:38.751Z
- Modified: 2026-10-26T22:10:00.163Z
- Weaknesses: CWE-170
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- gphoto libgphoto2: <= 2.5.33

## References

- <https://github.com/gphoto/libgphoto2/security/advisories/GHSA-ph87-cc3j-c6hm>
- <https://github.com/gphoto/libgphoto2/commit/259fc7d3bfe534ce4b114c464f55b448670ab873>

## Sources

- CVE List: [CVE-2026-40334](https://www.cve.org/CVERecord?id=CVE-2026-40334), CVE Terms of Use, modified 2026-04-20
- NVD: [CVE-2026-40334](https://nvd.nist.gov/vuln/detail/CVE-2026-40334), Public domain, modified 2026-10-26

---

Page: https://cve.day/CVE-2026-40334 · Whole record: https://cve.day/CVE-2026-40334.json · Rebuilt by cve.day 2026-11-25T22:59:18.981Z
