# CVE-2026-40333: libgphoto2 has OOB read in ptp_unpack_EOS_ImageFormat() and ptp_unpack_EOS_CustomFuncEx() due to missing length parameter in ptp-pack.c

- Severity: Medium 6.1 (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:H`
- 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.26%, higher than 11% of CVEs (2026-11-30)
- Published: 2026-04-17T23:11:11.073Z
- Modified: 2026-10-26T22:10:00.163Z
- 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. In versions up to and including 2.5.33, two functions in camlibs/ptp2/ptp-pack.c accept a data pointer but no length parameter, performing unbounded reads. Their callers in ptp_unpack_EOS_events() have xsize available but never pass it, leaving both functions unable to validate reads against the actual buffer boundary. Commit 1817ecead20c2aafa7549dac9619fe38f47b2f53 patches the issue.

(As written by CVE List.)

## Affected

- gphoto libgphoto2: <= 2.5.33

## References

- <https://github.com/gphoto/libgphoto2/security/advisories/GHSA-hq94-cp6h-3gjp>
- <https://github.com/gphoto/libgphoto2/commit/1817ecead20c2aafa7549dac9619fe38f47b2f53>

## Sources

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

---

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