CVEfocus › CVE database › CVE-2025-66038

CVE-2025-66038OpenSC: `sc_compacttlv_find_tag` can return out-of-bounds pointers

CVSS 3.9 LowEPSS 0.3% (higher than 19% of CVEs)Published 2026-03-30Updated 2026-04-01Assigner: GitHub_M

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.

CWE-126

What to do

Fixed builds are available from Debian: see the table below for the fixed version per release.

Debian, Red Hat, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

1Fixed
13Fix pending
1Under investigation
1Will not fix

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10openscFix pendingUBUNTU-CVE-2025-66038
Ubuntu 26.04openscUnder investigationUBUNTU-CVE-2025-66038
Ubuntu 25.10openscWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2025-66038
Ubuntu 24.04openscFix pendingUBUNTU-CVE-2025-66038
Ubuntu 22.04openscFix pendingUBUNTU-CVE-2025-66038
Ubuntu 20.04openscFix pendingUBUNTU-CVE-2025-66038
Ubuntu 18.04openscFix pendingUBUNTU-CVE-2025-66038
Ubuntu 16.04openscFix pendingUBUNTU-CVE-2025-66038
Debian 14openscFixed0.27.0~rc1-1DEBIAN-CVE-2025-66038
Debian 13openscFix pendingDEBIAN-CVE-2025-66038
Debian 12openscFix pendingDEBIAN-CVE-2025-66038
Red Hat Enterprise Linux 10openscFix pending
Fix deferred
Red Hat Enterprise Linux 10opensc-libsFix pending
Fix deferred
Red Hat Enterprise Linux 9openscFix pending
Fix deferred
Red Hat Enterprise Linux 8openscFix pending
Fix deferred
Red Hat Enterprise Linux 7openscFix pending
Fix deferred

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.