CVE-2026-40510: OpenSC < 0.27.0-rc1 Stack Buffer Overflow via piv_process_history() in card-piv.c

Published May 29, 2026
·
Updated

OpenSC < 0.27.0-rc1 Stack Buffer Overflow via pivprocesshistory() in card-piv.c

Other sources

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.

— NVD

Affected Software

7 affected componentsFixes available
OpenSC OpenSC<0.27.0-rc1
Microsoft azl3 opensc 0.27.1-1
Opensc Project Opensc<0.27.0
All of the following
azurelinux/opensc=0.27.1-1
Microsoft Azure Linux=3.0
All of the following
azurelinux/opensc<0:0.27.1-6.azl4
0:0.27.1-6.azl4
Microsoft Azure Linux=4.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade azurelinux/opensc to a version that resolves this vulnerability.

    Fixed in 0:0.27.1-6.azl4
  2. Upgrade

    Upgrade opensc to a version that resolves this vulnerability.

    Fixed in 0.27.0-rc1Patch 3f24f0b
  3. 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

May 29, 2026
CVE Published
via MITRE·01:26 PM
Data Sourced
via MITRE·01:26 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:16 PM
DescriptionSeverityWeakness
Event
via NVD·02:16 PM
May 31, 2026
Data Sourced
via Microsoft·08:01 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:01 AM
WeaknessAffected Software
Jun 3, 2026
Data Sourced
via NVD·02:30 PM
RemedyAffected Software
Updated
via NVD·02:30 PM
Severity

Frequently Asked Questions

1

What is the severity of CVE-2026-40510?

The severity of CVE-2026-40510 is rated as low with a score of 3.8.

2

How do I fix CVE-2026-40510?

To fix CVE-2026-40510, update OpenSC to version 0.27.0-rc1 or later.

3

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.

4

What type of vulnerability is CVE-2026-40510?

CVE-2026-40510 is classified as a stack buffer overflow vulnerability.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203