---
cve: "CVE-2026-40338"
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-08T09:38:14+02:00"
---

# CVE-2026-40338

> 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 the PTP_DPFF_Enumeration case of `ptp_unpack_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (line 856). The function reads a 2-byte enumeration count N via `dtoh16o(data, *poffset)` without verifying that 2 bytes remain in the buffer. The standard `ptp_unpack_DPD()` at line 704 has this exact check, confirming the Sony variant omitted it by oversight. Commit 3b9f9696be76ae51dca983d9dd8ce586a2561845 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)

- 3b9f9696be76ae51dca983d9dd8ce586a2561845 (Commit)

## Referenzen

- <https://github.com/gphoto/libgphoto2/security/advisories/GHSA-2hwp-w84q-27hf>
- <https://github.com/gphoto/libgphoto2/commit/3b9f9696be76ae51dca983d9dd8ce586a2561845>

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