CVE catalog

CVE-2026-40340

libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read vulnerability in `ptp_unpack_OI()` in `camlibs/ptp2/ptp-pack.c` (lines 530–563). The f

[CVE catalog]

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

libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read vulnerability in `ptp_unpack_OI()` in `camlibs/ptp2/ptp-pack.c` (lines 530–563). The function validates `len < PTP_oi_SequenceNumber` (i.e., len < 48) but subsequently accesses offsets 48–56, up to 9 bytes beyond the validated boundary, via the Samsung Galaxy 64-bit objectsize detection heuristic. Commit 7c7f515bc88c3d0c4098ac965d313518e0ccbe33 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
Ubuntulibgphoto214.042.5.2-0ubuntu5vulnerable
Ubuntulibgphoto214.042.5.2-0ubuntu6vulnerable
Ubuntulibgphoto214.042.5.3.1-0ubuntu1vulnerable
Ubuntulibgphoto214.042.5.3.1-1ubuntu2vulnerable
Ubuntulibgphoto214.042.5.3.1-1ubuntu2.2vulnerable
Ubuntulibgphoto216.042.5.8-1vulnerable
Ubuntulibgphoto216.042.5.8-2vulnerable
Ubuntulibgphoto216.042.5.8-3vulnerable
Ubuntulibgphoto216.042.5.9-2vulnerable
Ubuntulibgphoto216.042.5.9-3vulnerable
Ubuntulibgphoto218.042.5.14-1vulnerable
Ubuntulibgphoto218.042.5.16-2vulnerable
Ubuntulibgphoto220.042.5.23-2vulnerable
Ubuntulibgphoto220.042.5.24-1vulnerable
Ubuntulibgphoto220.042.5.25-0ubuntu0.1vulnerable
Ubuntulibgphoto222.042.5.27-1vulnerable
Ubuntulibgphoto222.042.5.27-1build1vulnerable
Ubuntulibgphoto222.042.5.27-1build2vulnerable
Ubuntulibgphoto222.042.5.27-1ubuntu0.1fixed
Ubuntulibgphoto224.042.5.30-1vulnerable
Ubuntulibgphoto224.042.5.31-1vulnerable
Ubuntulibgphoto224.042.5.31-2vulnerable
Ubuntulibgphoto224.042.5.31-2.1build1vulnerable
Ubuntulibgphoto224.042.5.31-2.1build2vulnerable
Ubuntulibgphoto224.042.5.31-2.1ubuntu1vulnerable
Ubuntulibgphoto224.042.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
Ubuntulibgphoto2deb22.042.5.27-1ubuntu0.1Not reportedUBUNTU-CVE-2026-40340Not reported
Ubuntulibgphoto2deb24.042.5.31-2.1ubuntu1.1Not reportedUBUNTU-CVE-2026-40340Not reported
Ubuntulibgphoto2deb26.042.5.33-1ubuntu1.1Not reportedUBUNTU-CVE-2026-40340Not 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