OpenSC is an open source smart card tools and middleware. Prior to version 0.27.0, sccompacttlvfindtag 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 sccompacttlvfindtag 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 sccompacttlvfind_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.
{
"cwe_ids": [
"CWE-126"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/66xxx/CVE-2025-66038.json",
"cna_assigner": "GitHub_M"
}{
"extracted_events": [
{
"introduced": "0"
},
{
"fixed": "0.27.0"
}
],
"cpe": "cpe:2.3:a:opensc_project:opensc:*:*:*:*:*:*:*:*",
"source": [
"CPE_RANGE",
"REFERENCES"
]
}[
{
"target": {
"file": "src/libopensc/card-idprime.c"
},
"digest": {
"line_hashes": [
"197077062409851014049150881454686052651",
"116874431869949048830812280705968601837",
"178347451590943443467517413724441716670",
"64384897257287561373260242149812150104",
"128939127976228477246498514475977417660",
"328551807216414904676468422493279414826",
"275193146505267519530501610440190952955",
"125295909231836846075869067429066912866",
"92530406835395599398656616018502244074"
],
"threshold": 0.9
},
"id": "CVE-2025-66038-7af18f0d",
"signature_type": "Line",
"signature_version": "v1",
"deprecated": false,
"source": "https://github.com/opensc/opensc/commit/6db171bcb6fd7cb3b51098fefbb3b28e44f0a79c"
}
]
"2026-06-18T13:17:17Z"
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-66038.json"