Every CVE Search/ Get API key

CVE-2021-42778

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.

5.3 MediumFix available

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
Low

Exploit likelihood

2.14%Up 1.3 points since Apr 19, 2022
90%50%10%1%

What each source reports

NVD Score used 5.3

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.

Record
CVE-2021-42778
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CVSS 2.0
5.0 MediumAV:N/AC:L/Au:N/C:N/I:N/A:P
Weakness
CWE-672, CWE-415
Updated
2026-11-02
CVE List No score

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.

Record
CVE-2021-42778
Weakness
CWE-672
Updated
2026-11-02
EUVDEUVD-2021-29734 No score

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.

Record
EUVD-2021-29734
Updated
2026-11-02
GitHub AdvisoriesGHSA-rh37-88v6-qm47 5.3

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.

Record
GHSA-rh37-88v6-qm47
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weakness
CWE-415, CWE-672
Updated
2026-11-02
OSVAZL-9481 5.3

CVE-2021-42778 affecting package opensc for versions less than 0.22.0-1

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.

Record
AZL-9481
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-02
OSV 5.3

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.

Record
CVE-2021-42778
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-02
OSVDEBIAN-CVE-2021-42778 5.3

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.

Record
DEBIAN-CVE-2021-42778
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-02
OSVOESA-2022-1664 5.3

opensc security update

OpenSC provides a set of libraries and utilities to work with smart cards. Its main focus is on cards that support cryptographic operations, and facilitate their use in security applications such as authentication, mail encryption and digital signatures. OpenSC implements the standard APIs to smart cards, e.g. PKCS#11 API, Windows’ Smart Card Minidriver and macOS Tokend.

Security Fix(es):

A heap double free issue was found in Opensc before version 0.22.0 in sc_pkcs15_free_tokeninfo.(CVE-2021-42778)

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.(CVE-2021-42780)

Stack buffer overflow issues were found in Opensc before version 0.22.0 in various places that could potentially crash programs using the library.(CVE-2021-42782)

Record
OESA-2022-1664
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
opensc
Azure Linux:2
before 0.22.0-1
0.22.0-1
opensc
Debian:12
before 0.22.0-1
0.22.0-1
opensc
Debian:13
before 0.22.0-1
0.22.0-1
opensc
Debian:14
before 0.22.0-1
0.22.0-1
opensc
Debian:11
From an advisory covering 18 CVEs
before 0.21.0-1+deb11u1, plus listed versions
0.21.0-1
0.21.0-1+deb11u1
opensc
openEuler:22.03-LTS
From an advisory covering 3 CVEs
before 0.21.0-6.oe2203
0.21.0-6.oe2203

History

History
RecordedChangedSources
affected, facts
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-42778 is a medium vulnerability (CVSS 5.3) in Opensc, published April 18, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.14%, the 82nd percentile. Fixed in opensc 0.22.0-1.

References

Show 5 moreShow less
MoveEnter Open