CVEfocus › CVE database › CVE-2026-40335

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

CVSS 5.2 MediumEPSS 0.2% (higher than 8% of CVEs)Published 2026-04-17Updated 2026-04-20Assigner: GitHub_M

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.

CWE-125

What to do

Fixed builds are available from Debian, Ubuntu: see the table below for the fixed version per release.

Debian, Red Hat, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

4Fixed
14Fix pending
3Will not fix

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04libgphoto2Fixed2.5.33-1ubuntu1.1UBUNTU-CVE-2026-40335
Ubuntu 25.10libgphoto2Will not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2026-40335
Ubuntu 24.04libgphoto2Fixed2.5.31-2.1ubuntu1.1UBUNTU-CVE-2026-40335
Ubuntu 22.04libgphoto2Fixed2.5.27-1ubuntu0.1UBUNTU-CVE-2026-40335
Ubuntu 20.04libgphoto2Fix pendingUBUNTU-CVE-2026-40335
Ubuntu 18.04libgphoto2Fix pendingUBUNTU-CVE-2026-40335
Ubuntu 16.04libgphoto2Fix pendingUBUNTU-CVE-2026-40335
Ubuntu 14.04libgphoto2Fix pendingUBUNTU-CVE-2026-40335
Debian 14libgphoto2Fixed2.5.34-1DEBIAN-CVE-2026-40335
Debian 13libgphoto2Fix pendingDEBIAN-CVE-2026-40335
Debian 12libgphoto2Fix pendingDEBIAN-CVE-2026-40335
Red Hat Enterprise Linux 10libgphoto2Fix pending
Fix deferred
Red Hat Enterprise Linux 10libgphoto2-develFix pending
Fix deferred
Red Hat Enterprise Linux 9libgphoto2Fix pending
Fix deferred
Red Hat Enterprise Linux 9libgphoto2-develFix pending
Fix deferred
Red Hat Enterprise Linux 8libgphoto2Fix pending
Fix deferred
Red Hat Enterprise Linux 8libgphoto2-develFix pending
Fix deferred
Red Hat Enterprise Linux 7libgphoto2Fix pending
Fix deferred
Red Hat Enterprise Linux 7libgphoto2-develFix pending
Fix deferred
Red Hat Enterprise Linux 6libgphoto2Will not fix
Out of support scope
Red Hat Enterprise Linux 6libgphoto2-develWill not fix
Out of support scope

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.