2026-11-28 2:21CVE-2026-138158VulnCheck
PUBLISHED5.2CWE-121

libgphoto2 through 2.5.34 Stack Buffer Overflow via sierra_get_string_register()

libgphoto2 through 2.5.34 contains a stack buffer overflow in sierra_get_string_register() that lets a malicious sierra-protocol camera or USB device overwrite stack memory. When files are listed, the device can answer the file-name register with an oversized packet, writing up to 32 KB past small stack buffers to cause crashes or possible code execution.

Problem type

Affected products

gphoto

libgphoto2

<= 2.5.34 - AFFECTED

References

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-138158
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-138158",
    "assignerOrgId": "83251b91-4cc7-4094-a5c7-464a1b83ea10",
    "assignerShortName": "VulnCheck",
    "dateUpdated": "2026-11-28T02:21:56.791Z",
    "dateReserved": "2026-11-28T02:14:59.747Z",
    "datePublished": "2026-11-28T02:21:56.791Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "83251b91-4cc7-4094-a5c7-464a1b83ea10",
        "shortName": "VulnCheck",
        "dateUpdated": "2026-11-28T02:21:56.791Z"
      },
      "datePublic": "2026-11-08T00:00:00.000Z",
      "title": "libgphoto2 through 2.5.34 Stack Buffer Overflow via sierra_get_string_register()",
      "descriptions": [
        {
          "lang": "en",
          "value": "libgphoto2 through 2.5.34 contains a stack buffer overflow in sierra_get_string_register() that lets a malicious sierra-protocol camera or USB device overwrite stack memory. When files are listed, the device can answer the file-name register with an oversized packet, writing up to 32 KB past small stack buffers to cause crashes or possible code execution."
        }
      ],
      "affected": [
        {
          "vendor": "gphoto",
          "product": "libgphoto2",
          "repo": "https://github.com/gphoto/libgphoto2",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "0",
              "status": "affected",
              "versionType": "semver",
              "lessThanOrEqual": "2.5.34"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "Stack-based Buffer Overflow",
              "cweId": "CWE-121",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/gphoto/libgphoto2/security/advisories/GHSA-4f44-frcc-8824",
          "name": "GitHub Security Advisory (GHSA-4f44-frcc-8824)",
          "tags": [
            "vendor-advisory"
          ]
        },
        {
          "url": "https://github.com/gphoto/libgphoto2/commit/c4cd525d7461c26b89b4705dc74fc4b84d57ff3a",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://github.com/gphoto/libgphoto2/blob/v2.5.34/camlibs/sierra/library.c#L1285-L1289",
          "tags": [
            "technical-description"
          ]
        },
        {
          "url": "https://github.com/gphoto/libgphoto2",
          "tags": [
            "product"
          ]
        },
        {
          "url": "https://www.vulncheck.com/advisories/libgphoto2-through-2.5.34-stack-buffer-overflow-via-sierra-get-string-register",
          "name": "VulnCheck Advisory: libgphoto2 through 2.5.34 Stack Buffer Overflow via sierra_get_string_register()",
          "tags": [
            "third-party-advisory"
          ]
        }
      ],
      "metrics": [
        {
          "format": "CVSS"
        },
        {
          "format": "CVSS",
          "cvssV3_1": {
            "version": "3.1",
            "vectorString": "CVSS:3.1/AV:P/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
            "attackVector": "PHYSICAL",
            "attackComplexity": "LOW",
            "privilegesRequired": "NONE",
            "userInteraction": "REQUIRED",
            "scope": "UNCHANGED",
            "confidentialityImpact": "HIGH",
            "integrityImpact": "HIGH",
            "availabilityImpact": "HIGH",
            "baseScore": 6.6,
            "baseSeverity": "MEDIUM"
          }
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Deus Rex",
          "type": "finder"
        }
      ]
    }
  }
}