gphoto libgphoto2 up to 2.5.33 camlibs/ptp2/ptp-pack.c ptp_unpack_OI out-of-bounds
| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 5.1 | $0-$5k | 4.65- |
Summary
A vulnerability categorized as critical has been discovered in gphoto libgphoto2 up to 2.5.33. The impacted element is the function ptp_unpack_OI of the file camlibs/ptp2/ptp-pack.c. Executing a manipulation can lead to out-of-bounds.
This vulnerability is handled as CVE-2026-40340. The physical device can be targeted for the attack. There is not any exploit available.
It is advisable to upgrade the affected component.
Details
A vulnerability classified as critical was found in gphoto libgphoto2 up to 2.5.33. This vulnerability affects the function ptp_unpack_OI of the file camlibs/ptp2/ptp-pack.c. The manipulation with an unknown input leads to a out-of-bounds vulnerability. The CWE definition for the vulnerability is CWE-125. The product reads data past the end, or before the beginning, of the intended buffer. As an impact it is known to affect confidentiality, integrity, and availability. CVE summarizes:
libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read vulnerability in `ptp_unpack_OI()` in `camlibs/ptp2/ptp-pack.c` (lines 530–563). The function validates `len < PTP_oi_SequenceNumber` (i.e., len < 48) but subsequently accesses offsets 48–56, up to 9 bytes beyond the validated boundary, via the Samsung Galaxy 64-bit objectsize detection heuristic. Commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33 fixes the issue.
The advisory is shared for download at github.com. This vulnerability was named CVE-2026-40340 since 04/11/2026. The exploitation appears to be easy. The attack needs to be approached locally. No form of authentication is required for a successful exploitation. There are known technical details, but no exploit is available.
The vulnerability scanner Nessus provides a plugin with the ID 307459 (Linux Distros Unpatched Vulnerability : CVE-2026-40340), which helps to determine the existence of the flaw in a target environment.
Upgrading to version 2.5.33 eliminates this vulnerability. Applying the patch 7c7f515bc88c3d0c4098ac965d313518e0ccbe33 is able to eliminate this problem. The bugfix is ready for download at github.com. The best possible mitigation is suggested to be upgrading to the latest version.
The vulnerability is also documented in the databases at Tenable (307459) and EUVD (EUVD-2026-23609). Once again VulDB remains the best source for vulnerability data.
Product
Vendor
Name
Version
- 2.5.0
- 2.5.1
- 2.5.2
- 2.5.3
- 2.5.4
- 2.5.5
- 2.5.6
- 2.5.7
- 2.5.8
- 2.5.9
- 2.5.10
- 2.5.11
- 2.5.12
- 2.5.13
- 2.5.14
- 2.5.15
- 2.5.16
- 2.5.17
- 2.5.18
- 2.5.19
- 2.5.20
- 2.5.21
- 2.5.22
- 2.5.23
- 2.5.24
- 2.5.25
- 2.5.26
- 2.5.27
- 2.5.28
- 2.5.29
- 2.5.30
- 2.5.31
- 2.5.32
- 2.5.33
License
Website
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔒VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 5.2VulDB Meta Temp Score: 5.1
VulDB Base Score: 4.3
VulDB Temp Score: 4.1
VulDB Vector: 🔒
VulDB Reliability: 🔍
CNA Base Score: 6.1
CNA Vector (GitHub_M): 🔒
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍
Exploiting
Class: Out-of-boundsCWE: CWE-125 / CWE-119
CAPEC: 🔒
ATT&CK: 🔒
Physical: Yes
Local: Yes
Remote: No
Availability: 🔒
Status: Not defined
EPSS Score: 🔒
EPSS Percentile: 🔒
Price Prediction: 🔍
Current Price Estimation: 🔒
| 0-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
Nessus ID: 307459
Nessus Name: Linux Distros Unpatched Vulnerability : CVE-2026-40340
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: UpgradeStatus: 🔍
0-Day Time: 🔒
Upgrade: libgphoto2 2.5.33
Patch: 7c7f515bc88c3d0c4098ac965d313518e0ccbe33
Timeline
04/11/2026 CVE reserved04/18/2026 Advisory disclosed
04/18/2026 VulDB entry created
04/18/2026 VulDB entry last update
Sources
Product: github.comAdvisory: GHSA-xfw3-xvjp-5wcv
Status: Confirmed
CVE: CVE-2026-40340 (🔒)
GCVE (CVE): GCVE-0-2026-40340
GCVE (VulDB): GCVE-100-358156
EUVD: 🔒
Entry
Created: 04/18/2026 08:57Updated: 04/18/2026 22:23
Changes: 04/18/2026 08:57 (68), 04/18/2026 18:57 (1), 04/18/2026 22:23 (2)
Complete: 🔍
Cache ID: 216::103
Once again VulDB remains the best source for vulnerability data.
No comments yet. Languages: en.
Please log in to comment.