CVE-2026-40339 json
libgphoto2 has OOB read in ptp_unpack_Sony_DPD() FormFlag parsing in ptp-pack.c
published 6mo ago modified 15d ago also EUVD-2026-23607
- cvss
- 5.2
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 9%
- public exploits
- 0
- none known
Summary
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_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (line 842). The function reads the FormFlag byte via `dtoh8o(data, *poffset)` without a prior bounds check. The standard `ptp_unpack_DPD()` at lines 686–687 correctly validates `*offset + sizeof(uint8_t) > dpdlen` before this same read, but the Sony variant omits this check entirely. Commit 09f8a940b1e418b5693f5c11e3016a1ad2cea62d fixes the issue.
Patch / fix
- libgphoto2 Debian 14 2.5.34-1
debian advisories DEBIAN-CVE-2026-40339
- libgphoto2 Ubuntu 22.04 LTS 2.5.27-1ubuntu0.1
- libgphoto2 Ubuntu 24.04 LTS 2.5.31-2.1ubuntu1.1
- libgphoto2 Ubuntu 26.04 LTS 2.5.33-1ubuntu1.1
ubuntu advisories UBUNTU-CVE-2026-40339
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- libgphoto2 openSUSE Tumbleweed 2.5.34-1.1
opensuse advisories openSUSE-SU-2026:10916-1
Is CVE-2026-40339 in your stack? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-40339 updated cvss 5.0
libgphoto2: libgphoto2: Information Disclosure via out-of-bounds read
-
Red Hat Enterprise Linux 6 libgphoto2 Red Hat Enterprise Linux 7 libgphoto2 Red Hat Enterprise Linux 8 libgphoto2 Red Hat Enterprise Linux 9 libgphoto2 Red Hat Enterprise Linux 10 libgphoto2affected: workaround, no fix available “Fix deferred”
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 6mo ago
Exploit prediction
0.20% chance of exploitation in the next 30 days, higher than 9% of all scored CVEs (FIRST EPSS, 2026-11-09).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 5.2 | CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L |
Affected products
- gphoto libgphoto2
Classification
- Weakness
-
- CWE-125 Out-of-bounds Read
References
Sources
- CVE List CVE-2026-40339
- NVD CVE-2026-40339
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.