CVE-2021-42780
Description
A use after return issue was found in Opensc before version 0.22.0 in insert_pin function that could potentially crash programs using the library.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A use-after-return bug in OpenSC's insert_pin function before 0.22.0 can crash programs using the library.
Vulnerability
OpenSC before version 0.22.0 contains a use-after-return bug in the insert_pin function in tcos.c [1]. The function reads a record from a smart card and iterates over its TLV data without always verifying that the buffer index remains within bounds [1]. When processing malformed or specially crafted card responses, the code may continue reading past the record boundary, leading to a use of a stack pointer that has already been returned or freed [1][3].
Exploitation
An attacker must have the ability to present a malicious smart card or emulate an authentication service that supplies crafted APDU responses to a system using OpenSC [1][3]. No special privileges on the target system are needed beyond physical or proximity access to a card reader, or the ability to deliver a crafted card image via a virtual smart card. The attacker does not need to authenticate to the system beforehand [3].
Impact
Successful exploitation causes the program using OpenSC to crash, resulting in a denial of service (DoS) [1][2][3]. The referenced sources do not describe a path to privilege escalation or information disclosure; the impact is limited to availability loss [3].
Mitigation
The vulnerability has been fixed in OpenSC 0.22.0 [1][2]. Users should upgrade to this version or later [2]. The Gentoo Security Advisory (GLSA 202209-03) states there is no known workaround; the only remediation is to update the library [2]. The issue is not listed on CISA's Known Exploited Vulnerabilities (KEV) catalog as of the publication date.
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
32(expand)+ 1 more
- (no CPE)
- (no CPE)range: <0.22.0
- osv-coords30 versionspkg: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%20Point%20of%20Sale%2011%20SP3pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP2pkg:rpm/suse/opensc&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg: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.19.0-150100.3.16.1+ 29 more
- (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.11.6-5.27.14.1
- (no CPE)range: < 0.19.0-150100.3.16.1
- (no CPE)range: < 0.11.6-5.27.14.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
5- security.gentoo.org/glsa/202209-03mitrevendor-advisory
- lists.debian.org/debian-lts-announce/2023/06/msg00025.htmlmitremailing-list
- bugs.chromium.org/p/oss-fuzz/issues/detailmitre
- bugzilla.redhat.com/show_bug.cgimitre
- github.com/OpenSC/OpenSC/commit/5df913b7mitre
News mentions
0No linked articles in our index yet.