{"answers":{"affected":"","exploited":"There is no known exploitation of CVE-2026-40340 in the wild and no public exploit code.","fix":"Apply the vendor's patch.","what":"CVE-2026-40340 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-40340 and fix it if it is affected.\n\nWhat it is: CVE-2026-40340 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-40340 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-40340/ (Markdown: https://insights.sbomify.com/CVE-2026-40340/index.md)","id":"CVE-2026-40340","markdown":"https://insights.sbomify.com/CVE-2026-40340/index.md","name":"CVE-2026-40340","record":{"aliases":["AZL-83030","DEBIAN-CVE-2026-40340","GHSA-xfw3-xvjp-5wcv","UBUNTU-CVE-2026-40340"],"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 information via a malicious PTP response.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":6.1,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","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 vulnerability in `ptp_unpack_OI()` in `camlibs/ptp2/ptp-pack.c` (lines 530–563). The function validates `len \u003c PTP_oi_SequenceNumber` (i.e., len \u003c 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.","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_OI() in ptp-pack.c via malicious PTP ObjectInfo response","id":"CVE-2026-40340","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 an OOB Read in ptp_unpack_EOS_FocusInfoEx","id":"CVE-2026-40341"},"packages":[],"prev":{"headline":"libgphoto2 has OOB read in ptp_unpack_Sony_DPD() FormFlag parsing in ptp-pack.c","id":"CVE-2026-40339"},"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 information via a malicious PTP response.","url":"https://insights.sbomify.com/CVE-2026-40340/"}