{"answers":{"affected":"","exploited":"There is no known exploitation of CVE-2026-40338 in the wild and no public exploit code.","fix":"Apply the vendor's patch.","what":"CVE-2026-40338 is a medium-severity memory corruption vulnerability in libgphoto2, published on 17 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-40338 and fix it if it is affected.\n\nWhat it is: CVE-2026-40338 is a medium-severity memory corruption vulnerability in libgphoto2, published on 17 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2026-40338 in the wild and no public exploit code.\n\nAffected product: libgphoto2. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-40338/ (Markdown: https://insights.sbomify.com/CVE-2026-40338/index.md)","id":"CVE-2026-40338","markdown":"https://insights.sbomify.com/CVE-2026-40338/index.md","name":"CVE-2026-40338","record":{"aliases":["AZL-83027","DEBIAN-CVE-2026-40338","GHSA-2hwp-w84q-27hf","UBUNTU-CVE-2026-40338"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["denial_of_service","data_read"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Camera access library","requires_auth":"none","summary":"An out-of-bounds read in libgphoto2 allows attackers to cause denial of service or disclose memory contents via crafted PTP data.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":5.2,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L","version":"3.1"},"cwes":[{"id":"CWE-125","name":"Out-of-bounds Read"}],"description":"libgphoto2 is a camera access and control library. Versions up to and including 2.5.33 have an out-of-bounds read in the PTP_DPFF_Enumeration case of `ptp_unpack_Sony_DPD()` in `camlibs/ptp2/ptp-pack.c` (line 856). The function reads a 2-byte enumeration count N via `dtoh16o(data, *poffset)` without verifying that 2 bytes remain in the buffer. The standard `ptp_unpack_DPD()` at line 704 has this exact check, confirming the Sony variant omitted it by oversight. Commit 3b9f9696be76ae51dca983d9dd8ce586a2561845 fixes the issue.","ecosystems":[],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"libgphoto2 has OOB read in ptp_unpack_Sony_DPD() enumeration count parsing in ptp-pack.c","id":"CVE-2026-40338","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":null,"product":null,"products":[],"type":"memory_corruption","year":"2026"},"n_packages":0,"n_references":2,"next":{"headline":"libgphoto2 has OOB read in ptp_unpack_Sony_DPD() FormFlag parsing in ptp-pack.c","id":"CVE-2026-40339"},"packages":[],"prev":{"headline":"Sentry kernel has incomplete ownership check for IRQ line manipulation","id":"CVE-2026-40337"},"products":["libgphoto2"],"published":"2026-04-17","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-04-20","vendors":["gphoto"]},"summary":"An out-of-bounds read in libgphoto2 allows attackers to cause denial of service or disclose memory contents via crafted PTP data.","url":"https://insights.sbomify.com/CVE-2026-40338/"}