CVE-2026-40510: OpenSC < 0.27.0-rc1 Stack Buffer Overflow via piv_process_history() in card-piv.c
OpenSC before 0.27.0-rc1, fixed in commit 3f24f0b, contains a stack buffer overflow vulnerability in pivprocesshistory() 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
openscto a version that resolves this vulnerability.Fixed in 0.27.0-rc1Patch 3f24f0b - Compensating control
Mitigate physically present exploitation by preventing/controlling access to the system’s smart-card/USB interfaces used for PIV cards (limit who can present a crafted PIV smart card/USB device).
Event History
Frequently Asked Questions
What is the severity of CVE-2026-40510?
The severity of CVE-2026-40510 is rated as low with a score of 3.8.
How do I fix CVE-2026-40510?
To fix CVE-2026-40510, update OpenSC to version 0.27.0-rc1 or later.
What is the impact of CVE-2026-40510?
CVE-2026-40510 allows physical attackers to trigger memory corruption by using a crafted PIV smart card or USB device.
What type of vulnerability is CVE-2026-40510?
CVE-2026-40510 is classified as a stack buffer overflow vulnerability.
How can a physical attacker exploit CVE-2026-40510?
A physical attacker can exploit CVE-2026-40510 by presenting a specially crafted PIV smart card that triggers the buffer overflow.