Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2026-40338— libgphoto2 has OOB read in ptp_unpack_Sony_DPD() enumeration count parsing in ptp-pack.c

CVSS 5.2 · Medium EPSS 0.01% · P1
Get alerts for future matching vulnerabilitiesLog in to subscribe

I. Basic Information for CVE-2026-40338

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
libgphoto2 has OOB read in ptp_unpack_Sony_DPD() enumeration count parsing in ptp-pack.c
Source: NVD (National Vulnerability Database)
Vulnerability 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.
Source: NVD (National Vulnerability Database)
CVSS Information
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L
Source: NVD (National Vulnerability Database)
Vulnerability Type
跨界内存读
Source: NVD (National Vulnerability Database)
Vulnerability Title
libgphoto2 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
libgphoto2是gPhoto开源的一个数码相机访问与控制库。 libgphoto2 2.5.33及之前版本存在安全漏洞,该漏洞源于camlibs/ptp2/ptp-pack.c文件中ptp_unpack_Sony_DPD函数在PTP_DPFF_Enumeration情况下读取2字节枚举计数时未验证缓冲区剩余字节,可能导致越界读取。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

VendorProductAffected VersionsCPESubscribe
gphotolibgphoto2 <= 2.5.33 -

II. Public POCs for CVE-2026-40338

#POC DescriptionSource LinkShenlong Link
AI-Generated POCPremium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-40338

登录查看更多情报信息。

Same Patch Batch · gphoto · 2026-04-17 · 8 CVEs total

CVE-2026-403406.1 MEDIUMlibgphoto2 has OOB read in ptp_unpack_OI() in ptp-pack.c via malicious PTP ObjectInfo resp
CVE-2026-403336.1 MEDIUMlibgphoto2 has OOB read in ptp_unpack_EOS_ImageFormat() and ptp_unpack_EOS_CustomFuncEx()
CVE-2026-403395.2 MEDIUMlibgphoto2 has OOB read in ptp_unpack_Sony_DPD() FormFlag parsing in ptp-pack.c
CVE-2026-403355.2 MEDIUMlibgphoto2 has OOB read in ptp_unpack_DPV() UINT128/INT128 handling in ptp-pack.c
CVE-2026-403343.5 LOWlibgphoto2 missing null termination in ptp_unpack_Canon_FE() filename buffer in ptp-pack.c
CVE-2026-403413.5 LOWlibgphoto2 has an OOB Read in ptp_unpack_EOS_FocusInfoEx
CVE-2026-403362.4 LOWlibgphoto2 has memory leak in ptp_unpack_Sony_DPD() secondary enumeration list in ptp-pack

IV. Related Vulnerabilities

V. Comments for CVE-2026-40338

No comments yet


Leave a comment