VYPR
Unrated severityNVD Advisory· Published Apr 18, 2022· Updated Nov 3, 2025

CVE-2021-42779

CVE-2021-42779

Description

A heap use after free issue was found in Opensc before version 0.22.0 in sc_file_valid.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A heap use-after-free vulnerability in OpenSC before 0.22.0 allows a crafted smart card to cause a denial of service or potentially execute arbitrary code.

Vulnerability

A heap use-after-free issue exists in OpenSC versions prior to 0.22.0 in the sc_file_valid function. The flaw occurs when a smart card provides specially crafted data that leads to a free of a heap object followed by a later use. The exact code path is triggered during file operations including sc_file_valid [1].

Exploitation

An attacker must have physical access to the system or be able to insert a malicious smart card into a reader used by an application relying on OpenSC. The attacker crafts the card's responses to trigger the use-after-free during file validation routines [1]. No authentication is required beyond the ability to interact with the smart card reader.

Impact

Successful exploitation can lead to a denial of service via application crash, and under certain heap conditions may allow arbitrary code execution in the context of the process using OpenSC [3]. The CVSS base score is not fully disclosed, but the Red Hat bug report marks this as low severity [1].

Mitigation

OpenSC version 0.22.0 fixes this vulnerability [1][3]. Gentoo's GLSA 202209-03 recommends upgrading to >=dev-libs/opensc-0.22.0 via emerge --sync && emerge --ask --oneshot --verbose ">=dev-libs/opensc-0.22.0" [3]. No workaround is known for versions earlier than 0.22.0.

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

30

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

5

News mentions

0

No linked articles in our index yet.