CVE-2021-42781
Description
Heap buffer overflow issues were found in Opensc before version 0.22.0 in pkcs15-oberthur.c that could potentially crash programs using the library.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Heap buffer overflow in OpenSC before 0.22.0 in pkcs15-oberthur.c could crash programs using the library.
Vulnerability
Heap buffer overflow issues exist in OpenSC versions before 0.22.0 in the file pkcs15-oberthur.c. The vulnerabilities occur in functions sc_pkcs15emu_oberthur_add_cert, sc_pkcs15emu_oberthur_add_data, and sc_pkcs15emu_oberthur_add_pubkey when parsing certificate, data, and public key information from Oberthur smart cards. The code does not properly validate the lengths of fields such as labels, IDs, and OIDs before reading them, leading to out-of-bounds reads.
Exploitation
An attacker would need to present a crafted Oberthur smart card or emulated card to a system using the vulnerable OpenSC library. The library reads card files during PKCS#15 initialization. No special privileges beyond physical or logical access to supply the malicious card data are required. The exploitation is triggered when the library processes the malicious card data, causing heap buffer overflows.
Impact
Successful exploitation can lead to a heap buffer overflow, potentially causing a program crash (denial of service). In some cases, it might be possible to achieve further memory corruption, but the primary documented impact is a crash of the application using the OpenSC library.
Mitigation
The vulnerabilities are fixed in OpenSC version 0.22.0. Patches are available in the commits [1], [2], [3], and [4]. Users should upgrade to OpenSC 0.22.0 or later. No workaround is provided for earlier versions.
AI Insight generated on May 25, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
33(expand)+ 1 more
- (no CPE)
- (no CPE)range: <0.22.0
- osv-coords31 versionspkg:deb/ubuntu/opensc@0.15.0-1ubuntu1+esm1?arch=source&distro=esm-apps/xenialpkg:deb/ubuntu/opensc@0.17.0-3ubuntu0.1~esm1?arch=source&distro=esm-apps/bionicpkg:deb/ubuntu/opensc@0.20.0-3?arch=source&distro=focalpkg:rpm/opensuse/opensc&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/opensc&distro=openSUSE%20Tumbleweedpkg:rpm/suse/opensc&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/opensc&distro=SUSE%20Enterprise%20Storage%206pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-ESPOSpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-ESPOSpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-LTSSpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Micro%205.1pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP3pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP2pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3-BCLpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3-LTSSpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP4-LTSSpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-BCLpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%2015-LTSSpkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP3pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP4pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP1pkg:rpm/suse/opensc&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/opensc&distro=SUSE%20OpenStack%20Cloud%209pkg:rpm/suse/opensc&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/opensc&distro=SUSE%20OpenStack%20Cloud%20Crowbar%209
>= 0+ 30 more
- (no CPE)range: >= 0
- (no CPE)range: >= 0
- (no CPE)range: >= 0
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.22.0-1.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.18.0-150000.3.23.1
- (no CPE)range: < 0.18.0-150000.3.23.1
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.18.0-150000.3.23.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.18.0-150000.3.23.1
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.13.0-3.19.1
- (no CPE)range: < 0.13.0-3.19.1
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
8- security.gentoo.org/glsa/202209-03mitrevendor-advisory
- lists.debian.org/debian-lts-announce/2023/06/msg00025.htmlmitremailing-list
- bugzilla.redhat.com/show_bug.cgimitre
- github.com/OpenSC/OpenSC/commit/05648b06mitre
- github.com/OpenSC/OpenSC/commit/17d8980cmitre
- github.com/OpenSC/OpenSC/commit/40c50a3amitre
- github.com/OpenSC/OpenSC/commit/5d4daf6cmitre
- github.com/OpenSC/OpenSC/commit/cae5c71fmitre
News mentions
0No linked articles in our index yet.