CVE-2025-66038

OpenSC: `sc_compacttlv_find_tag` can return out-of-bounds pointers

MEDIUM
6.8
CVSS Score
Published: March 30, 2026 at 05:03 PM UTC
Updated: June 17, 2026 at 09:56 AM UTC
1 product affected across 1 vendorOpenSC

Using OpenSC by OpenSC?

Get instant alerts when new vulnerabilities affect OpenSC - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM6.8
Exploit prediction
EPSS 0.3%
SSVC
PoC

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 0.27.0
Affected range stops below 0.27.0, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (3)

x_refsource_CONFIRMExploitVendor Advisory
Source: cverecord
https://github.com/OpenSC/OpenSC/security/advisories/GHSA-72x5-fwjx-2459
x_refsource_MISCVendor Advisory
Source: cverecord
https://github.com/OpenSC/OpenSC/wiki/CVE-2025-66038

SSVC — Action Prioritization

SSVCPoCNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
PHYSICAL
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-126

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card