VYPR
Unrated severityNVD Advisory· Published Dec 1, 2019· Updated Aug 5, 2024

CVE-2019-19480

CVE-2019-19480

Description

An issue was discovered in OpenSC through 0.19.0 and 0.20.x through 0.20.0-rc3. libopensc/pkcs15-prkey.c has an incorrect free operation in sc_pkcs15_decode_prkdf_entry.

AI Insight

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

OpenSC through 0.20.0-rc3 has a double-free or use-after-free in sc_pkcs15_decode_prkdf_entry due to incorrect memory cleanup after ASN.1 decode failure.

Vulnerability

An issue was discovered in OpenSC through 0.19.0 and 0.20.x through 0.20.0-rc3. The function sc_pkcs15_decode_prkdf_entry in libopensc/pkcs15-prkey.c performs an incorrect free() operation when ASN.1 decoding fails. The original code attempted to free asn1_com_prkey_attr[0].parm under certain conditions, but after the fix it was changed to free info.subject.value. The incorrect cleanup can lead to memory corruption, such as double-free or use-after-free, when parsing a malformed private key object file [1][3]. The vulnerability is reachable when the card or token provides a specially crafted private key data object that triggers a decode error.

Exploitation

An attacker with physical access to the smart card or the ability to inject a malicious private key object into the token can supply a crafted ASN.1 structure. When OpenSC calls sc_pkcs15_decode_prkdf_entry, the decode failure triggers the erroneous free() path, potentially causing memory corruption. No authentication is needed beyond being able to present the malformed token to the system; the attacker does not require user interaction beyond the user inserting the card or loading the token.

Impact

Successful exploitation can lead to memory corruption, potentially resulting in denial of service (application crash) or arbitrary code execution in the context of the OpenSC process. The exact impact depends on the heap layout and the attacker's control over the freed memory. Given that OpenSC often runs with elevated privileges (e.g., for PKCS#11 operations), a compromise could allow privilege escalation or information disclosure [1].

Mitigation

The vulnerability is fixed in OpenSC version 0.20.0, released on 2019-12-29 [1][3]. Users should upgrade to at least 0.20.0. The commit [3] shows the specific fix: removing the incorrect free of asn1_com_prkey_attr[0].parm and instead freeing info.subject.value after a decode failure. There is no known workaround for older versions; upgrading is the recommended mitigation.

AI Insight generated on May 26, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

4

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

4

News mentions

0

No linked articles in our index yet.