CVE-2025-66038 OpenSC: `sc_compacttlv_find_tag` can return out-of-bounds pointers
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: no · technical impact: partial
- Technology
- UbuntuDebianRed Hat
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.
Upgrade path
14 packages: 3 fixed, 10 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/opensc(Debian 12) | = 0.23.0-0.3; = 0.23.0-0.3+deb12u1; = 0.23.0-0.3+deb12u2; = 0.23.0-1 +15 more | No fix listed | No fix yet |
| debian/opensc(Debian 13) | = 0.26.1-2; = 0.26.1-3; = 0.27.0~rc1-1; = 0.27.0~rc2-1 +3 more | No fix listed | No fix yet |
| redhat/opensc(Red Hat enterprise_linux 10) | All versions | No fix listed | No fix yet |
| redhat/opensc(Red Hat enterprise_linux 8) | All versions | No fix listed | No fix yet |
| redhat/opensc(Red Hat enterprise_linux 9) | All versions | No fix listed | No fix yet |
| redhat/opensc(Red Hat rhel_els 7) | All versions | No fix listed | No fix yet |
| ubuntu/opensc(Ubuntu 22.04) | All versions | No fix listed | No fix yet |
| ubuntu/opensc(Ubuntu 24.04) | All versions | No fix listed | No fix yet |
| ubuntu/opensc(Ubuntu 26.04) | All versions | No fix listed | No fix yet |
| ubuntu/opensc(Ubuntu 26.10) | All versions | No fix listed | No fix yet |
| azure linux opensc(Azure Linux 3.0) | < 0.27.1-1 | 0.27.1-1 | Fixed |
| debian/opensc(Debian 14) | < 0.27.0~rc1-1; = 0.26.1-2; = 0.26.1-3 | 0.27.0~rc1-1 | Fixed |
| opensc project opensc | < 0.27.0 | 0.27.0 | Fixed |
| opensc | = < 0.27.0 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| azure linux opensc(Azure Linux:3.0) | < 0.27.1-1 | 0.27.1-1 |
| debian/opensc(Debian:12) | All versions | No fix listed |
| debian/opensc(Debian:12) | = 0.23.0-0.3 | No fix listed |
| debian/opensc(Debian:12) | = 0.23.0-0.3+deb12u1 | No fix listed |
| debian/opensc(Debian:12) | = 0.23.0-0.3+deb12u2 | No fix listed |
| debian/opensc(Debian:12) | = 0.23.0-1 | No fix listed |
| debian/opensc(Debian:12) | = 0.23.0-2 | No fix listed |
| debian/opensc(Debian:12) | = 0.24.0~rc1-1 | No fix listed |
| debian/opensc(Debian:12) | = 0.25.0~rc1-1 | No fix listed |
| debian/opensc(Debian:12) | = 0.25.1-1 | No fix listed |
| debian/opensc(Debian:12) | = 0.25.1-2 | No fix listed |
| debian/opensc(Debian:12) | = 0.25.1-2.1 | No fix listed |
| debian/opensc(Debian:12) | = 0.26.0-1 | No fix listed |
| debian/opensc(Debian:12) | = 0.26.1-1 | No fix listed |
| debian/opensc(Debian:12) | = 0.26.1-2 | No fix listed |
| debian/opensc(Debian:12) | = 0.26.1-3 | No fix listed |
| debian/opensc(Debian:12) | = 0.27.0~rc1-1 | No fix listed |
| debian/opensc(Debian:12) | = 0.27.0~rc2-1 | No fix listed |
| debian/opensc(Debian:12) | = 0.27.1-1 | No fix listed |
| debian/opensc(Debian:12) | = 0.27.1-2 | No fix listed |
| debian/opensc(Debian:13) | All versions | No fix listed |
| debian/opensc(Debian:13) | = 0.26.1-2 | No fix listed |
| debian/opensc(Debian:13) | = 0.26.1-3 | No fix listed |
| debian/opensc(Debian:13) | = 0.27.0~rc1-1 | No fix listed |
| debian/opensc(Debian:13) | = 0.27.0~rc2-1 | No fix listed |
Show 15 more
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/opensc(Debian:13) | = 0.27.1-1 | No fix listed |
| debian/opensc(Debian:13) | = 0.27.1-2 | No fix listed |
| debian/opensc(Debian:14) | < 0.27.0~rc1-1 | 0.27.0~rc1-1 |
| debian/opensc(Debian:14) | = 0.26.1-2 | No fix listed |
| debian/opensc(Debian:14) | = 0.26.1-3 | No fix listed |
| opensc | = < 0.27.0 | No fix listed |
| ubuntu/opensc(Ubuntu:22.04) | All versions | No fix listed |
| redhat/opensc(Red Hat:enterprise_linux:10) | All versions | No fix listed |
| redhat/opensc(Red Hat:rhel_els:7) | All versions | No fix listed |
| redhat/opensc(Red Hat:enterprise_linux:8) | All versions | No fix listed |
| redhat/opensc(Red Hat:enterprise_linux:9) | All versions | No fix listed |
| ubuntu/opensc(Ubuntu:24.04) | All versions | No fix listed |
| ubuntu/opensc(Ubuntu:26.04) | All versions | No fix listed |
| ubuntu/opensc(Ubuntu:26.10) | All versions | No fix listed |
| opensc project opensc | < 0.27.0 | 0.27.0 |
References
- MSRC Security Update Guide vendor-advisory
- Release Notes vendor-advisory
- Debian Security Tracker CVE-2025-66038 vendor-advisory
- https://github.com/OpenSC/OpenSC/security/advisories/GHSA-72x5-fwjx-2459 exploit vendor-advisory
- https://github.com/OpenSC/OpenSC/commit/6db171bcb6fd7cb3b51098fefbb3b28e44f0a79c patch
- https://github.com/OpenSC/OpenSC/wiki/CVE-2025-66038 vendor-advisory
- Ubuntu CVE tracker vendor-advisory
- www.cve.org
- Red Hat CVE page mitigation vendor-advisory
- Red Hat Bugzilla 2453118 issue-tracking
- nvd.nist.gov