
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-66038 is a buffer over-read vulnerability in OpenSC's sc_compacttlv_find_tag function that can return out-of-bounds pointers when parsing maliciously crafted compact-TLV data, such as that found in smart card Answer to Reset (ATR) historical bytes. It affects all OpenSC versions prior to 0.27.0 (including 0.26.1 and earlier). The vulnerability was disclosed on March 30, 2026, and was originally discovered by Harrison Green from CMU via the STITCH autonomous fuzzing system. The CVSS v3.1 base score is 6.8 (Medium/High) per NVD, though the OpenSC advisory assigns a lower score of 3.9 (Low) reflecting the physical attack vector and high complexity (GitHub Advisory, OpenSC Wiki).
The root cause is insufficient bounds validation in the sc_compacttlv_find_tag function (CWE-126: Buffer Over-read; CWE-805: Buffer Access with Incorrect Length Value). In compact-TLV encoding, a single byte encodes both the tag (high nibble) and value length (low nibble). When given a 1-byte buffer {0x0A}, the function interprets tag=0 and length=10, but does not verify that the claimed 10-byte value fits within the remaining buffer — which contains zero bytes. As a result, the function returns a pointer to buf+1 with outlen=10, pointing beyond the buffer boundary. When downstream code dereferences this out-of-bounds pointer, memory corruption can occur. The vulnerability is reachable via untrusted data from smart cards or files, specifically through the PIV driver's parsing of historical bytes in ATR responses (GitHub Advisory, OpenSC Wiki).
Successful exploitation can result in memory corruption, application crashes (denial of service), and potentially unauthorized reads of memory contents (confidentiality impact). Because the vulnerability resides in the libopensc library, it is accessible from OpenSC tools, the PKCS#11 module, the minidriver, and the Cryptographic Token Kit (CTK), broadening the attack surface across all consumers of the library. Integrity and availability impacts are possible if downstream code writes to the out-of-bounds pointer, though the practical severity is constrained by the physical access requirement (OpenSC Wiki, GitHub Advisory).
A proof-of-concept (PoC) C++ testcase with a complete Dockerfile and build instructions is publicly available in the GitHub Security Advisory, demonstrating the out-of-bounds pointer condition (GitHub Advisory). Exploitation requires physical access to the target system — an attacker must present a crafted USB smart card or device that returns malicious ATR data. There is no evidence of in-the-wild exploitation, no known threat actor attribution, and the vulnerability is not listed in the CISA KEV catalog. The EPSS score is approximately 0.015% (0.000150), reflecting very low probability of automated exploitation (Feedly).
{0x0A} that claims tag=0 and length=10 with no following value bytes.opensc-tool, pkcs11-tool).sc_compacttlv_find_tag function processes the crafted buffer and returns a pointer to buf+1 with outlen=10, pointing beyond the allocated buffer.opensc-tool, pkcs11-tool, piv-tool) or PKCS#11-consuming applications (e.g., Firefox, SSH agents) logged in system logs (/var/log/syslog, journalctl).libopensc, potentially in /var/crash/ or the working directory of the affected process.The primary remediation is to upgrade OpenSC to version 0.27.0 or later, which includes the fix applied in commit a20b91adc2fc66785c0df98abc8ef456c0eaab9d (OpenSC Wiki). As a workaround where patching is not immediately possible, restrict physical access to systems to trusted personnel only and prohibit the use of smart cards or USB tokens from untrusted sources. Organizations using OpenSC in sensitive environments (e.g., PIV/CAC authentication) should prioritize patching given the library's broad exposure through PKCS#11, minidriver, and CTK interfaces (GitHub Advisory).
The vulnerability was reported by Harrison Green from Carnegie Mellon University and discovered via the STITCH autonomous fuzzing system, with patches provided by Jakub Jelen of the OpenSC project (OpenSC Wiki). Red Hat, Microsoft (Azure Linux), openSUSE, and Fedora have all issued advisories or package updates addressing this CVE, indicating broad downstream distribution response (Red Hat, Microsoft MSRC). Community reaction has been measured given the low severity rating and physical access requirement, with no significant social media controversy observed.
Fix availability across major Linux distributions and their releases.
bionic (esm-apps)
opensc
devel
opensc
focal (esm-apps)
opensc
jammy
opensc
jammy (esm-apps)
opensc
noble
opensc
noble (esm-apps)
opensc
resolute
opensc
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."