CVE-2025-66038OpenSC: `sc_compacttlv_find_tag` can return out-of-bounds pointers
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.
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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | opensc | Fix pending | UBUNTU-CVE-2025-66038 | |
| Ubuntu 26.04 | opensc | Under investigation | UBUNTU-CVE-2025-66038 | |
| Ubuntu 25.10 | opensc | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2025-66038 | |
| Ubuntu 24.04 | opensc | Fix pending | UBUNTU-CVE-2025-66038 | |
| Ubuntu 22.04 | opensc | Fix pending | UBUNTU-CVE-2025-66038 | |
| Ubuntu 20.04 | opensc | Fix pending | UBUNTU-CVE-2025-66038 | |
| Ubuntu 18.04 | opensc | Fix pending | UBUNTU-CVE-2025-66038 | |
| Ubuntu 16.04 | opensc | Fix pending | UBUNTU-CVE-2025-66038 | |
| Debian 14 | opensc | Fixed | 0.27.0~rc1-1 | DEBIAN-CVE-2025-66038 |
| Debian 13 | opensc | Fix pending | DEBIAN-CVE-2025-66038 | |
| Debian 12 | opensc | Fix pending | DEBIAN-CVE-2025-66038 | |
| Red Hat Enterprise Linux 10 | opensc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | opensc-libs | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | opensc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | opensc | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 7 | opensc | Fix 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.
- OpenSC: affected: < 0.27.0
References
- https://github.com/OpenSC/OpenSC/security/advisories/GHSA-72x5-fwjx-2459
- https://github.com/OpenSC/OpenSC/commit/6db171bcb6fd7cb3b51098fefbb3b28e44f0a79c
- https://github.com/OpenSC/OpenSC/wiki/CVE-2025-66038
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.