CVE catalog

CVE-2026-40336

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–885). When processing a sec

[CVE catalog]

Severity
Medium · CVSS 4.3CVSS:3.1/AV:P/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Published
Source
[NVD] · [CVE record]
EPSS
0.18% · Oct 27, 2026

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–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.

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
Debianlibgphoto2sid2.5.34-2fixed
Debianlibgphoto2forky2.5.34-2fixed
Debianlibgphoto2trixie2.5.31-4vulnerable
Debianlibgphoto2bookworm2.5.30-1vulnerable
Cpelibgphoto2Not reportedNot reportedvulnerable
Ubuntulibgphoto2noble2.5.31-2.1ubuntu1.1fixed
Ubuntulibgphoto2-6t64noble2.5.31-2.1ubuntu1.1fixed
Ubuntulibgphoto2-devnoble2.5.31-2.1ubuntu1.1fixed
Ubuntulibgphoto2-dev-docnoble2.5.31-2.1ubuntu1.1fixed
Ubuntulibgphoto2-l10nnoble2.5.31-2.1ubuntu1.1fixed
Ubuntulibgphoto2-port12t64noble2.5.31-2.1ubuntu1.1fixed
Ubuntulibgphoto225.102.5.31-4vulnerable
Ubuntulibgphoto225.102.5.31-4build1vulnerable
Ubuntulibgphoto225.102.5.31-4ubuntu1vulnerable
Ubuntulibgphoto226.042.5.31-4build1vulnerable
Ubuntulibgphoto226.042.5.32-1vulnerable
Ubuntulibgphoto226.042.5.33-1vulnerable
Ubuntulibgphoto226.042.5.33-1ubuntu1vulnerable
Ubuntulibgphoto226.042.5.33-1ubuntu1.1fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debianlibgphoto2sourcesid2.5.34-1not yet assignedNot reported[1134329]
Debianlibgphoto2sourceforky2.5.34-1not yet assignedNot reported[1134329]
Debianlibgphoto2sourcetrixie(unfixed)not yet assignedNot reported[1134329]
Debianlibgphoto2sourcebookworm(unfixed)not yet assignedNot reported[1134329]
Ubuntulibgphoto2debnoble2.5.31-2.1ubuntu1.1Not reportedNot reportedNot reported
Ubuntulibgphoto2-6t64debnoble2.5.31-2.1ubuntu1.1Not reportedNot reportedNot reported
Ubuntulibgphoto2-devdebnoble2.5.31-2.1ubuntu1.1Not reportedNot reportedNot reported
Ubuntulibgphoto2-dev-docdebnoble2.5.31-2.1ubuntu1.1Not reportedNot reportedNot reported
Ubuntulibgphoto2-l10ndebnoble2.5.31-2.1ubuntu1.1Not reportedNot reportedNot reported
Ubuntulibgphoto2-port12t64debnoble2.5.31-2.1ubuntu1.1Not reportedNot reportedNot reported
Ubuntulibgphoto2deb26.042.5.33-1ubuntu1.1Not reportedUBUNTU-CVE-2026-40336Not reported

[Debian bug #1134329]

Notes

[trixie] libgphoto2: Minor issue [bookworm] libgphoto2: Minor issue

OpenFactory catalog packages

[Debian 12 (Bookworm)]

  • [libgphoto2-6]Affected

    Source package: [libgphoto2]

    Details (2)
    • 2.5.30-1 · amd64 · bookworm

      Affected

      nvd · libgphoto2 · debian · bookworm; nvd · libgphoto2 · debian · 12

    • 2.5.30-1 · arm64 · bookworm

      Affected

      nvd · libgphoto2 · debian · bookworm; nvd · libgphoto2 · debian · 12

  • [libgphoto2-dev]Affected

    Source package: [libgphoto2]

    Details (2)
    • 2.5.30-1 · amd64 · bookworm

      Affected

      nvd · libgphoto2 · debian · bookworm; nvd · libgphoto2 · debian · 12

    • 2.5.30-1 · arm64 · bookworm

      Affected

      nvd · libgphoto2 · debian · bookworm; nvd · libgphoto2 · debian · 12

  • Source package: [libgphoto2]

    Details (2)
    • 2.5.30-1 · all · bookworm

      Affected

      nvd · libgphoto2 · debian · bookworm; nvd · libgphoto2 · debian · 12

    • 2.5.30-1 · all · bookworm

      Affected

      nvd · libgphoto2 · debian · bookworm; nvd · libgphoto2 · debian · 12

  • [libgphoto2-l10n]Affected

    Source package: [libgphoto2]

    Details (2)
    • 2.5.30-1 · all · bookworm

      Affected

      nvd · libgphoto2 · debian · bookworm; nvd · libgphoto2 · debian · 12

    • 2.5.30-1 · all · bookworm

      Affected

      nvd · libgphoto2 · debian · bookworm; nvd · libgphoto2 · debian · 12

  • Source package: [libgphoto2]

    Details (2)
    • 2.5.30-1 · amd64 · bookworm

      Affected

      nvd · libgphoto2 · debian · bookworm; nvd · libgphoto2 · debian · 12

    • 2.5.30-1 · arm64 · bookworm

      Affected

      nvd · libgphoto2 · debian · bookworm; nvd · libgphoto2 · debian · 12

[Debian 13 (Trixie)]

  • [libgphoto2-6t64]Affected

    Source package: [libgphoto2]

    Details (2)
    • 2.5.31-4 · amd64 · trixie

      Affected

      nvd · libgphoto2 · debian · 13

    • 2.5.31-4 · arm64 · trixie

      Affected

      nvd · libgphoto2 · debian · 13

  • [libgphoto2-dev]Affected

    Source package: [libgphoto2]

    Details (2)
    • 2.5.31-4 · amd64 · trixie

      Affected

      nvd · libgphoto2 · debian · 13

    • 2.5.31-4 · arm64 · trixie

      Affected

      nvd · libgphoto2 · debian · 13

  • Source package: [libgphoto2]

    Details (2)
    • 2.5.31-4 · all · trixie

      Affected

      nvd · libgphoto2 · debian · 13

    • 2.5.31-4 · all · trixie

      Affected

      nvd · libgphoto2 · debian · 13

  • [libgphoto2-l10n]Affected

    Source package: [libgphoto2]

    Details (2)
    • 2.5.31-4 · all · trixie

      Affected

      nvd · libgphoto2 · debian · 13

    • 2.5.31-4 · all · trixie

      Affected

      nvd · libgphoto2 · debian · 13

  • Source package: [libgphoto2]

    Details (2)
    • 2.5.31-4 · amd64 · trixie

      Affected

      nvd · libgphoto2 · debian · 13

    • 2.5.31-4 · arm64 · trixie

      Affected

      nvd · libgphoto2 · debian · 13

Observed:

References