---
cve: "CVE-2026-40339"
severity: "MEDIUM"
cvss: 5.2
epss: "20%"
vendor: "gphoto"
kev: false
exploited: false
published: "2026-04-18 00:16:37"
tags: [cve, security, medium]
source: tsecurity.de CVE-Dossier
exported: "2026-09-08T06:37:56+02:00"
---

# CVE-2026-40339

> 5.2 MEDIUM · 🧪 PoC

## Beschreibung

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.

## CVSS-Vektor

```
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L
```

| Metrik | Wert | Bewertung |
|---|---|---|
| AV Angriffsvektor | Physisch | good |
| AC Komplexität | Gering | bad |
| PR Privilegien | Keine | bad |
| UI Interaktion | Keine | bad |
| S Scope | Unverändert | good |
| C Vertraulichkeit | Hoch | bad |
| I Integrität | Keine | good |
| A Verfügbarkeit | Gering | warn |

## Patch verfügbar (OSV)

- 09f8a940b1e418b5693f5c11e3016a1ad2cea62d (Commit)

## Referenzen

- <https://github.com/gphoto/libgphoto2/security/advisories/GHSA-42cm-m9hc-r7q8>
- <https://github.com/gphoto/libgphoto2/commit/09f8a940b1e418b5693f5c11e3016a1ad2cea62d>

---
_Exportiert aus dem [tsecurity.de CVE-Dossier](https://tsecurity.de/cve?cve=CVE-2026-40339) · Datenquellen: EUVD (ENISA), NVD, OSV, CISA KEV, FIRST EPSS, Exploit-DB, BSI BITS_
