CVE-2021-42780
published 2022-04-18CVE-2021-42780: 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.
PriorityP426medium5.3CVSS 3.1
AVNACLPRNUINSUCNINAL
EPSS
2.09%
79.7th percentile
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.
Affected
19 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | opensc | < opensc 0.22.0-1 (bookworm) | opensc 0.22.0-1 (bookworm) |
| fedoraproject | fedora | — | — |
| msrc | cbl2_opensc_0.22.0-1_on_cbl_mariner_2.0 | — | — |
| opensc_project | opensc | < 0.22.0 | 0.22.0 |
| opensc_project | opensc | — | — |
| opensc_project | opensc | >= 0 < 0.21.0-1+deb11u1 | 0.21.0-1+deb11u1 |
| opensc_project | opensc | >= 0 < 0.22.0-1 | 0.22.0-1 |
| opensc_project | opensc | >= 0 < 0.22.0-1 | 0.22.0-1 |
| opensc_project | opensc | >= 0 < 0.22.0-1 | 0.22.0-1 |
| opensc_project | opensc | >= 0 < 0.15.0-1ubuntu1+esm3 | 0.15.0-1ubuntu1+esm3 |
| opensc_project | opensc | >= 0 < 0.15.0-1ubuntu1+esm2 | 0.15.0-1ubuntu1+esm2 |
| opensc_project | opensc | >= 0 < 0.17.0-3ubuntu0.1~esm3 | 0.17.0-3ubuntu0.1~esm3 |
| opensc_project | opensc | >= 0 < 0.17.0-3ubuntu0.1~esm2 | 0.17.0-3ubuntu0.1~esm2 |
| opensc_project | opensc | >= 0 < 0.20.0-3ubuntu0.1~esm3 | 0.20.0-3ubuntu0.1~esm3 |
| opensc_project | opensc | >= 0 < 0.20.0-3ubuntu0.1~esm4 | 0.20.0-3ubuntu0.1~esm4 |
| opensc_project | opensc | >= 0 < 0.20.0-3ubuntu0.1~esm2 | 0.20.0-3ubuntu0.1~esm2 |
| opensc_project | opensc | >= 0 < 0.22.0-1ubuntu2+esm1 | 0.22.0-1ubuntu2+esm1 |
| opensc_project | opensc | >= 0 < 0.25.0~rc1-1ubuntu0.1~esm1 | 0.25.0~rc1-1ubuntu0.1~esm1 |
| redhat | enterprise_linux | — | — |
CVSS provenance
nvdv3.15.3MEDIUMCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
nvdv2.05.0MEDIUMAV:N/AC:L/Au:N/C:N/I:N/A:P
osv5.3MEDIUM
vendor_debian5.3MEDIUM
vendor_msrc5.3MEDIUM
vendor_redhat5.3MEDIUM
vendor_ubuntu5.3MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
opensc vulnerabilities
osv·2025-04-09·CVSS 5.3
[MEDIUM] opensc vulnerabilities
opensc vulnerabilities
USN-7346-1 fixed vulnerabilities in OpenSC. The update introduced a
regression which broke smartcard based authentication. This update fixes
the problem.
We apologize for the inconvenience.
Original advisory details:
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffer overflow. An attacker
could possibly use this issue to cause a denial of service or execute
arbitrary code.
OSV
opensc regression
osv·2025-03-28·CVSS 5.3
[MEDIUM] opensc regression
opensc regression
USN-7346-1 fixed vulnerabilities in OpenSC. The update introduced a
regression in Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, and Ubuntu 20.04 LTS. The
security fix has been removed pending further investigation.
We apologize for the inconvenience.
Original advisory details:
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffer overflow. An attacker
could possibly use this issue to cause
OSV
opensc vulnerabilities
osv·2025-03-12·CVSS 5.3
CVE-2021-42780 [MEDIUM] opensc vulnerabilities
opensc vulnerabilities
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffer overflow. An attacker
could possibly use this issue to cause a denial of service or execute
arbitrary code. This issue only affected Ubuntu 20.04 LTS. (CVE-2021-42782)
It was discovered that OpenSC did not correctly handle the length of
certain buffers, which could lead to a out-of-bounds access vulnerability.
An attacker co
GHSA
GHSA-7wjg-mhwg-m2rc: A use after return issue was found in Opensc before version 0
ghsa_unreviewed·2022-04-19
CVE-2021-42780 [MEDIUM] CWE-252 GHSA-7wjg-mhwg-m2rc: A use after return issue was found in Opensc before version 0
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.
OSV
CVE-2021-42780: A use after return issue was found in Opensc before version 0
osv·2022-04-18·CVSS 5.3
CVE-2021-42780 [MEDIUM] CVE-2021-42780: A use after return issue was found in Opensc before version 0
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.
Ubuntu
OpenSC vulnerabilities
vendor_ubuntu·2025-04-09·CVSS 5.3
CVE-2021-42780 [MEDIUM] OpenSC vulnerabilities
Title: OpenSC vulnerabilities
Summary: USN-7346-1 introduced a regression in OpenSC.
USN-7346-1 fixed vulnerabilities in OpenSC. The update introduced a
regression which broke smartcard based authentication. This update fixes
the problem.
We apologize for the inconvenience.
Original advisory details:
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffer overflow. An attacker
could possibly use thi
Ubuntu
OpenSC regression
vendor_ubuntu·2025-03-28·CVSS 5.3
[MEDIUM] OpenSC regression
Title: OpenSC regression
Summary: USN-7346-1 introduced a regression in OpenSC.
USN-7346-1 fixed vulnerabilities in OpenSC. The update introduced a
regression in Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, and Ubuntu 20.04 LTS. The
security fix has been removed pending further investigation.
We apologize for the inconvenience.
Original advisory details:
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffe
Ubuntu
OpenSC vulnerabilities
vendor_ubuntu·2025-03-12·CVSS 5.3
CVE-2021-42780 [MEDIUM] OpenSC vulnerabilities
Title: OpenSC vulnerabilities
Summary: Several security issues were fixed in opensc.
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffer overflow. An attacker
could possibly use this issue to cause a denial of service or execute
arbitrary code. This issue only affected Ubuntu 20.04 LTS. (CVE-2021-42782)
It was discovered that OpenSC did not correctly handle the length of
certain buffers, which cou
Microsoft
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.
vendor_msrc·2022-04-12·CVSS 5.3
CVE-2021-42780 [MEDIUM] CWE-252 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.
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.
FAQ: Is Azure Linux the only Microsoft product that includes this open-source library and is therefore potentially affected by this vulnerability?
One of the main benefits to our customers who choose to use the Azure Linux distro is the commitment to keep it up to date with the most recent and most secure versions of the open source libraries with which the distro is composed. Microsoft is committed to transparency in this work which is why we began publishing CSAF/VEX in October 2025. See this blog post for more information. If impact to additional products is identified, we will update the CVE to reflect this.
Mariner: Mariner
redhat: redha
Red Hat
opensc: Use after return in insert_pin function
vendor_redhat·2021-01-09·CVSS 5.3
CVE-2021-42780 [MEDIUM] CWE-252 opensc: Use after return in insert_pin function
opensc: Use after return in insert_pin function
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.
Package: opensc (Red Hat Enterprise Linux 7) - Out of support scope
Package: opensc (Red Hat Enterprise Linux 8) - Fix deferred
Package: opensc (Red Hat Enterprise Linux 9) - Not affected
Debian
CVE-2021-42780: opensc - A use after return issue was found in Opensc before version 0.22.0 in insert_pin...
vendor_debian·2021·CVSS 5.3
CVE-2021-42780 [MEDIUM] CVE-2021-42780: opensc - A use after return issue was found in Opensc before version 0.22.0 in insert_pin...
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.
Scope: local
bookworm: resolved (fixed in 0.22.0-1)
bullseye: resolved (fixed in 0.21.0-1+deb11u1)
forky: resolved (fixed in 0.22.0-1)
sid: resolved (fixed in 0.22.0-1)
trixie: resolved (fixed in 0.22.0-1)
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28383https://bugzilla.redhat.com/show_bug.cgi?id=2016139https://github.com/OpenSC/OpenSC/commit/5df913b7https://lists.debian.org/debian-lts-announce/2023/06/msg00025.htmlhttps://security.gentoo.org/glsa/202209-03https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28383https://bugzilla.redhat.com/show_bug.cgi?id=2016139https://github.com/OpenSC/OpenSC/commit/5df913b7https://lists.debian.org/debian-lts-announce/2023/06/msg00025.htmlhttps://lists.debian.org/debian-lts-announce/2024/12/msg00026.htmlhttps://security.gentoo.org/glsa/202209-03
2022-04-18
Published