Cyber Resilience

CVE-2026-40334

Published
18 April 2026
Modified
20 April 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.0019 9th percentile
Risk Priority 28 floored blend · peak EPSS

Summary

CVE-2026-40334 is a low-severity Improper Null Termination (CWE-170) vulnerability. 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 9th 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

T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
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.
T1210 Exploitation of Remote Services Lateral Movement
Adversaries may exploit remote services to gain unauthorized access to internal systems once inside of a network.
T1212 Exploitation for Credential Access Credential Access
Adversaries may exploit software vulnerabilities in an attempt to collect credentials.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2023-36906Shared CWE-170
CVE-2024-31197Shared CWE-170
CVE-2026-32837Shared CWE-170
CVE-2024-43474Shared CWE-170
CVE-2025-2026Shared CWE-170
CVE-2024-31484Shared CWE-170
CVE-2025-67790Shared CWE-170
CVE-2023-28263Shared CWE-170
CVE-2023-48674Shared CWE-170
CVE-2026-23749Shared CWE-170

Affected Assets

In
inferred from references and description; NVD did not file a CPE for this CVE

Mitigating Controls

Mitigating Controls (NIST 800-53 r5) AI

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) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

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

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

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

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

prevents

Secure SDLC mandates input validation and string handling rules that prevent missing null terminators.

prevents

Application security requirements can explicitly call for proper string termination and buffer handling.

degrades

Secure architecture principles include defensive coding practices that address buffer and string termination issues.

prevents

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

References