# CVE-2026-40335: libgphoto2 has OOB read in ptp_unpack_DPV() UINT128/INT128 handling in ptp-pack.c

- Severity: Medium 5.2 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/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.21%, higher than 11% of CVEs (2026-12-01)
- Published: 2026-04-17T23:19:16.935Z
- Modified: 2026-10-25T23:10:00.167Z
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read in `ptp_unpack_DPV()` in `camlibs/ptp2/ptp-pack.c` (lines 622–629). The UINT128 and INT128 cases advance `*offset += 16` without verifying that 16 bytes remain in the buffer. The entry check at line 609 only guarantees `*offset < total` (at least 1 byte available), leaving up to 15 bytes unvalidated. Commit 433bde9888d70aa726e32744cd751d7dbe94379a patches the issue.

(As written by CVE List.)

## Affected

- gphoto libgphoto2: <= 2.5.33

## References

- <https://github.com/gphoto/libgphoto2/security/advisories/GHSA-g4g5-c2x9-cqfj>
- <https://github.com/gphoto/libgphoto2/commit/433bde9888d70aa726e32744cd751d7dbe94379a>

## Sources

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

---

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