UBUNTU-CVE-2026-40336 (CVE-2026-40336)
Vulnerability from osv_ubuntu – Published: 2026-04-18 00:16 – Updated: 2026-07-22 18:37 – Source websitelibgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have a memory leak in ptp_unpack_Sony_DPD() in camlibs/ptp2/ptp-pack.c (lines 884–885). When processing a secondary enumeration list (introduced in 2024+ Sony cameras), the function overwrites dpd->FORM.Enum.SupportedValue with a new calloc() without freeing the previous allocation from line 857. The original array and any string values it contains are leaked on every property descriptor parse. Commit 404ff02c75f3cb280196fc260a63c4d26cf1a8f6 fixes the issue.
{
"affected": [
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libgphoto2-6t64",
"binary_version": "2.5.31-4ubuntu1"
},
{
"binary_name": "libgphoto2-l10n",
"binary_version": "2.5.31-4ubuntu1"
},
{
"binary_name": "libgphoto2-port12t64",
"binary_version": "2.5.31-4ubuntu1"
}
]
},
"package": {
"ecosystem": "Ubuntu:25.10",
"name": "libgphoto2",
"purl": "pkg:deb/ubuntu/libgphoto2@2.5.31-4ubuntu1?arch=source\u0026distro=questing"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.5.31-4",
"2.5.31-4build1",
"2.5.31-4ubuntu1"
]
},
{
"ecosystem_specific": {
"availability": "No subscription required",
"binaries": [
{
"binary_name": "libgphoto2-6t64",
"binary_version": "2.5.33-1ubuntu1.1"
},
{
"binary_name": "libgphoto2-l10n",
"binary_version": "2.5.33-1ubuntu1.1"
},
{
"binary_name": "libgphoto2-port12t64",
"binary_version": "2.5.33-1ubuntu1.1"
}
]
},
"package": {
"ecosystem": "Ubuntu:26.04:LTS",
"name": "libgphoto2",
"purl": "pkg:deb/ubuntu/libgphoto2@2.5.33-1ubuntu1.1?arch=source\u0026distro=resolute"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.5.33-1ubuntu1.1"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.5.31-4build1",
"2.5.32-1",
"2.5.33-1",
"2.5.33-1ubuntu1"
]
}
],
"aliases": [],
"details": "libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have a memory leak in `ptp_unpack_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (lines 884\u2013885). When processing a secondary enumeration list (introduced in 2024+ Sony cameras), the function overwrites dpd-\u003eFORM.Enum.SupportedValue with a new calloc() without freeing the previous allocation from line 857. The original array and any string values it contains are leaked on every property descriptor parse. Commit 404ff02c75f3cb280196fc260a63c4d26cf1a8f6 fixes the issue.",
"id": "UBUNTU-CVE-2026-40336",
"modified": "2026-07-22T18:37:17Z",
"published": "2026-04-18T00:16:00Z",
"references": [
{
"type": "REPORT",
"url": "https://ubuntu.com/security/CVE-2026-40336"
},
{
"type": "REPORT",
"url": "https://www.cve.org/CVERecord?id=CVE-2026-40336"
},
{
"type": "REPORT",
"url": "https://github.com/gphoto/libgphoto2/security/advisories/GHSA-g8xw-p5wj-mrxv"
},
{
"type": "ADVISORY",
"url": "https://ubuntu.com/security/notices/USN-8586-1"
}
],
"related": [
"USN-8586-1"
],
"schema_version": "1.7.0",
"severity": [
{
"score": "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
},
{
"score": "medium",
"type": "Ubuntu"
}
],
"upstream": [
"CVE-2026-40336"
]
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.