Security Resilience

CVE-2026-40334

libgphoto2

Published
18 April 2026
Modified
26 October 2026
CVSS Score v3.1 3.5
Click a component to see what it means
Raw vectorCVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
EPSS Score 0.0022 7th percentile
Risk Priority 29 floored blend · peak EPSS

CVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). EPSS, Forum of Incident Response and Security Teams (FIRST), epss.first.org. Risk Priority is our own derived reading, not an NVD score.

Summary

CVE-2026-40334 is a low-severity Improper Null Termination (CWE-170) vulnerability in libgphoto2 (named in the CVE record; NVD lists no product yet). Its CVSS base score is 3.5 (Low).

Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked at the 7th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SA-15 (Development Process, Standards, and Tools) — see the control section below for these in your framework.

EU & UK References

Vulnerability Data

libgphoto2 is a camera access and control library. In versions up to and including 2.5.33, a missing null terminator exists in ptp_unpack_Canon_FE() in camlibs/ptp2/ptp-pack.c (line 1377). The function copies a filename into a 13-byte buffer using strncpy without explicitly null-terminating…

more

the result. If the source data is exactly 13 bytes with no null terminator, the buffer is left unterminated, leading to out-of-bounds reads in any subsequent string operation. Commit 259fc7d3bfe534ce4b114c464f55b448670ab873 patches the issue.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

MITRE ATT&CK v20.0

T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
T1499.004 Application or System Exploitation Impact
Adversaries may exploit software vulnerabilities that can cause an application or system to crash and deny availability to users.
T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1203 Exploitation for Client Execution Execution
Adversaries may exploit software vulnerabilities in client applications to execute code.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2023-36907Shared CWE-170
CVE-2026-70587Shared CWE-170
CVE-2026-83781Shared CWE-170
CVE-2023-28263Shared CWE-170
CVE-2025-2026Shared CWE-170
CVE-2024-31484Shared CWE-170
CVE-2026-23749Shared CWE-170
CVE-2024-21442Shared CWE-170
CVE-2023-36906Shared CWE-170
CVE-2025-66220Shared CWE-170

Affected Assets

gphoto
libgphoto2
named in the CVE record; NVD lists no product yet

Mitigating Controls

Mitigating Controls (NIST 800-53 r5)

Our mappings, made for this CVE.

Developer testing and evaluation can discover missing or incorrect string termination during code review or dynamic analysis.

Requiring documented development standards and tools can enforce safe string-handling practices that produce correct null termination.

Mitigating Controls (NIST CSF 2.0)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→CSF cross-walk — links open the control.

PR.PS-06 mostly match
blocks

Secure SDLC practices directly enforce correct string/array termination via coding standards, reviews, and static analysis.

Mitigating Controls (ISO/IEC 27001:2022 Annex A)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→ISO cross-walk — links open the control.

finds

Security testing in development can detect missing or incorrect null terminators before release.

prevents

Training technical developers about string-handling functions (strncpy, readlink, etc.) and null-termination requirements reduces some instances of CWE-170, but the weakness is a low-level C/C++ implementation detail that even trained developers introduce through off-by-one errors and misuse of 'safe' functions, so training moves only a minority of instances.

prevents

Secure coding standards directly require correct null termination of strings and arrays.

prevents

A.8.30 carries its effect through the secure-development practices (8.25 to 8.29) it contracts from the supplier, so a faithful implementation reduces ordinary software implementation defects like CWE-170 in delivered code, at the same `partial` rung the owner set for CWE-134 on this clause.

finds

A.8.8's reach is disclosure-based (vendor advisories, vulnerability scanning, third-party library tracking), so it finds CWE-170 only where the null-termination defect surfaces as a published CVE in a third-party component — a minority of instances, since most CWE-170 lives in first-party source code that A.8.8 does not read.

References