Description
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.
Published: 2026-04-17
Score: 5.2 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Information disclosure via out‑of‑bounds read
Action: Patch
AI Analysis

Impact

An out‑of‑bounds read exists in libgphoto2’s ptp_unpack_DPV() function when handling UINT128 and INT128 values. The function advances the read offset by 16 bytes without confirming that the buffer contains that many bytes, potentially exposing up to 15 bytes of adjacent memory. This vulnerability could allow an attacker to read sensitive data from the process’s address space, but it does not provide any form of code execution or privilege escalation.

Affected Systems

The flaw affects gphoto:libgphoto2 versions up to and including 2.5.33. Any application that processes data from cameras or PTP-compatible devices using this library is potentially impacted. No other product or version information is available in the advisory.

Risk and Exploitability

The CVSS score of 5.2 indicates a moderate impact, and the EPSS score is not available. The vulnerability is not listed in the CISA KEV catalogue. The likely attack vector requires an attacker to supply crafted data to a camera or PTP device that the library parses, which is typically a trusted device. Successful exploitation would result in information disclosure, not remote code execution.

Generated by OpenCVE AI on April 18, 2026 at 08:48 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade libgphoto2 to a version that includes the patch (committed in 433bde9888d70aa726e32744cd751d7dbe94379a).
  • If an upgrade is not possible, restrict or sandbox usage of libgphoto2 so that only trusted cameras can supply data, preventing untrusted data from reaching the vulnerable code path.
  • Apply additional bounds checking in any custom code that interacts with libgphoto2 to ensure that reading 16 bytes will not exceed the buffer’s length.

Generated by OpenCVE AI on April 18, 2026 at 08:48 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 17 Apr 2026 23:45:00 +0000

Type Values Removed Values Added
Description 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.
Title libgphoto2 has OOB read in ptp_unpack_DPV() UINT128/INT128 handling in ptp-pack.c
Weaknesses CWE-125
References
Metrics cvssV3_1

{'score': 5.2, 'vector': 'CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-04-17T23:19:16.935Z

Reserved: 2026-04-10T22:50:01.357Z

Link: CVE-2026-40335

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-04-18T00:16:37.390

Modified: 2026-04-18T00:16:37.390

Link: CVE-2026-40335

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-18T09:00:05Z

Weaknesses