libgphoto2 Patch Fixes High-Severity Stack Overflow in Sierra Camera Protocol

2 min read
Source: CVEs | Zero Wire | Cloudflare Radar
libgphoto2 Patch Fixes High-Severity Stack Overflow in Sierra Camera Protocol
Photo: CVEs | Zero Wire | Cloudflare Radar
TL;DR

A high-severity vulnerability in libgphoto2, affecting versions up to 2.5.34, has been patched. The flaw allows a malicious device to crash or potentially execute code by sending oversized data during file listing.

Key points

  • The vulnerability, CVE-2026-138158, exists in the sierra_get_string_register() function of libgphoto2, which handles communication with Nikon cameras using the sierra protocol.
  • A malicious device can exploit the flaw by sending an oversized packet when listing files, writing up to 32 KB past small stack buffers, leading to crashes or possible code execution.
  • The issue was discovered by the Deus Rex security research team at Cyrex, who demonstrated a deterministic crash on production builds.
  • The fix, released in commit c4cd525d, adds a size parameter to the function to check incoming packets against buffer capacity before copying data.
  • The vulnerability is rated 7.0 High under CVSS 4.0 and 6.6 Medium under CVSS 3.1, with a physical attack vector requiring no privileges.

Background

Recent weeks have seen a series of high-severity stack buffer overflow vulnerabilities in various software, including GNU Inetutils, D-Link routers, VMware ESX, and FFmpeg. These flaws often allow attackers to crash systems or execute code by sending malformed data. The libgphoto2 vulnerability is similar in nature but requires physical access to the device, though network-based USB/IP transport could increase severity.

Why it matters

This vulnerability affects a widely used library for camera communication, potentially impacting users of Nikon cameras or any system using libgphoto2. While the attack requires physical access, the potential for code execution makes it a significant security risk, especially in environments where untrusted devices may be connected.

What to watch

Users of libgphoto2 should update to a version that includes the patch (commit c4cd525d or later) to mitigate the risk. Organizations should also review their device connection policies to ensure only trusted devices are connected to systems using this library.

Share this article

Want the full story? Read the original reporting

Read on CVEs | Zero Wire | Cloudflare Radar