← Vulnerability feed

Vulnerability record · CVE-2025-66038 · published 30 March 2026

CVE-2025-66038: Opensc project opensc vulnerability

Opensc Project · Opensc

OpenSC is an open source smart card tools and middleware. Prior to version 0.27.0, sc_compacttlv_find_tag searches a compact-TLV buffer for a given tag. In compact-TLV, a single byte encodes the tag (high nibble) and value length (low nibble). With a 1-byte buffer {0x0A}, the encoded element claims tag=0 and length=10 but no value bytes follow. Calling sc_compacttlv_find_tag with search tag 0x00 returns a pointer equal to buf+1 and outlen=10 without verifying that the claimed value length fits within the remaining buffer. In cases where the sc_compacttlv_find_tag is provided untrusted data (such as being read from cards/files), attackers may be able to influence it to return out-of-bounds pointers leading to downstream memory corruption when subsequent code tries to dereference the pointer. This issue has been patched in version 0.27.0.

6.8 CVSS 3.1 Medium EPSS 0.33% · top 81.4% CWE-126 · CWE-126
6.8CVSS 3.1 base score
0.33%EPSS exploitation probability, 30 days
NoNot in CISA KEV
1Affected product versions listed by NVD
3References, 1 tagged exploit
17 Jun 2026Last modified by NVD

Description

OpenSC is an open source smart card tools and middleware. Prior to version 0.27.0, sc_compacttlv_find_tag searches a compact-TLV buffer for a given tag. In compact-TLV, a single byte encodes the tag (high nibble) and value length (low nibble). With a 1-byte buffer {0x0A}, the encoded element claims tag=0 and length=10 but no value bytes follow. Calling sc_compacttlv_find_tag with search tag 0x00 returns a pointer equal to buf+1 and outlen=10 without verifying that the claimed value length fits within the remaining buffer. In cases where the sc_compacttlv_find_tag is provided untrusted data (such as being read from cards/files), attackers may be able to influence it to return out-of-bounds pointers leading to downstream memory corruption when subsequent code tries to dereference the pointer. This issue has been patched in version 0.27.0.

CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected products

1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2025-66038 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

7.5CVE-2021-34193Opensc project opensc out-of-bounds write vulnerabilityStack overflow vulnerability in OpenSC smart card middleware before 0.23 via crafted responses to APDUs.EPSS 1.4%7.5CVE-2019-16058Opensc project opensc memory buffer overflow vulnerabilityAn issue was discovered in the pam_p11 component 0.2.0 and 0.3.0 for OpenSC. If a smart card creates a signature with a length longer than 256 bytes,…EPSS 1.5%7.5CVE-2019-6502Opensc project opensc memory leak vulnerabilitysc_context_create in ctx.c in libopensc in OpenSC 0.19.0 has a memory leak, as demonstrated by a call from eidenv.EPSS 2.2%7.1CVE-2023-2977Opensc project opensc memory buffer overflow vulnerabilityA vulnerbility was found in OpenSC. This security flaw cause a buffer overrun vulnerability in pkcs15 cardos_have_verifyrc_package. The attacker can …EPSS 0.36%6.8CVE-2025-66037Opensc project opensc out-of-bounds read vulnerabilityOpenSC is an open source smart card tools and middleware. Prior to version 0.27.0, feeding a crafted input to the fuzz_pkcs15_reader harness causes O…EPSS 0.28%6.8CVE-2025-66215Opensc project opensc stack-based buffer overflow vulnerabilityOpenSC is an open source smart card tools and middleware. Prior to version 0.27.0, an attacker with physical access to the computer at the time user …EPSS 0.28%6.8CVE-2025-49010Opensc project opensc stack-based buffer overflow vulnerabilityOpenSC is an open source smart card tools and middleware. Prior to version 0.27.0, an attacker with physical access to the computer at the time user …EPSS 0.24%6.8CVE-2019-20792Opensc project opensc double free vulnerabilityOpenSC before 0.20.0 has a double free in coolkey_free_private_data because coolkey_add_object in libopensc/card-coolkey.c lacks a uniqueness check.EPSS 0.66%

Source: NIST National Vulnerability Database (record CVE-2025-66038), CISA KEV, FIRST EPSS (scores of 2026-11-25). This page is refreshed as NVD updates the record.