{"id":"CVE-2026-40510","summary":"OpenSC \u003c 0.27.0-rc1 Stack Buffer Overflow via piv_process_history() in card-piv.c","details":"OpenSC before 0.27.0-rc1, fixed in commit 3f24f0b, contains a stack buffer overflow vulnerability in piv_process_history() in src/libopensc/card-piv.c that allows physically present attackers to trigger memory corruption by presenting a crafted PIV smart card or USB device returning a URL field longer than 118 bytes in the Key History Object ASN.1 response.","modified":"2026-07-08T08:05:09.863423187Z","published":"2026-05-29T13:26:40.459Z","database_specific":{"cwe_ids":["CWE-121"],"unresolved_ranges":[{"source":"AFFECTED_FIELD","extracted_events":[{"fixed":"3f24f0b48a481a8cf2e46059d8238a283ddc1c13"}]}],"cna_assigner":"VulnCheck","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40510.json"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40510.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40510"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/opensc-stack-buffer-overflow-via-piv-process-history-in-card-piv-c"},{"type":"REPORT","url":"https://github.com/OpenSC/OpenSC/pull/3558"},{"type":"FIX","url":"https://github.com/OpenSC/OpenSC/commit/3f24f0b48a481a8cf2e46059d8238a283ddc1c13"},{"type":"PACKAGE","url":"https://github.com/OpenSC/OpenSC"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/opensc/opensc","events":[{"introduced":"0"},{"fixed":"aca07679a6dd281ee6411f5e7de2ed0ee796bee8"},{"fixed":"3f24f0b48a481a8cf2e46059d8238a283ddc1c13"}],"database_specific":{"source":["CPE_RANGE","REFERENCES"],"extracted_events":[{"introduced":"0"},{"fixed":"0.27.0"}],"cpe":"cpe:2.3:a:opensc_project:opensc:*:*:*:*:*:*:*:*"}}],"versions":["0.27.0-rc2","tag-test","0.27.0-rc1","0.26.0","0.26.0-rc1","0.25.0","0.25.0-rc1","0.24.0","0.24.0-rc2","0.24.0-rc1","0.23.0","0.23.0-rc2","0.23.0-rc1","0.22.0","0.22.0-rc2","0.22.0-rc1","0.21.0","0.21.0-rc2","0.21.0-rc1","0.20.0","0.20.0-rc4","0.20.0-rc3","0.20.0-rc2","0.20.0-rc1","0.19.0","0.19.0-rc1","0.18.0","0.18.0-rc2","0.18.0-rc1","0.17.0","0.17.0-rc2","0.17.0-rc1","0.16.0","v0.16.0-pre1","0.15.0","0.14.0","0.14.0rtm","0.14.0rc2","0.13.0","0.13.0rc1","0.13.0pre1","v0.12.2","0.12.2","0.12.2-rc1"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-40510.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:P/AC:H/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"}]}