Every CVE Search/ Get API key

CVE-2025-66038

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

3.9 LowFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Physical
Complexity
High
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
Low
Integrity
Low
Availability
Low

Exploit likelihood

0.29%Up 0.3 points since Mar 31, 2026
90%50%10%1%

What each source reports

CVE List Score used 3.9

OpenSC: `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.

Record
CVE-2025-66038
CVSS 3.1
3.9 LowCVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
Weakness
CWE-126
Updated
2026-11-02
EUVDEUVD-2025-209127 3.9

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.

Record
EUVD-2025-209127
CVSS 3.1
3.9 LowCVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
NVD 3.9

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.

Record
CVE-2025-66038
CVSS 3.1
3.9 LowCVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
CVSS 3.1
6.8 MediumCVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-126
Updated
2026-11-02
OSVBELL-CVE-2025-66038 6.8
Record
BELL-CVE-2025-66038
CVSS 3.1
6.8 MediumCVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSV 3.9

OpenSC: `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.

Record
CVE-2025-66038
CVSS 3.1
3.9 LowCVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
Weakness
CWE-126
Updated
2026-11-02
OSVDEBIAN-CVE-2025-66038 6.8

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.

Record
DEBIAN-CVE-2025-66038
CVSS 3.1
6.8 MediumCVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
Show 13 moreShow less
OSVUBUNTU-CVE-2025-66038 3.9

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.

Record
UBUNTU-CVE-2025-66038
CVSS 3.1
3.9 LowCVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
CVSS 3.1
6.8 MediumCVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVAZL-81192 No score

CVE-2025-66038 affecting package opensc 0.27.1-3

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.

Record
AZL-81192
Updated
2026-11-05
OSVCLSA-2026-1779190223 No score

opensc: Fix of 5 CVEs

  • CVE-2023-5992: implement constant-time PKCS#1 v1.5 depadding to prevent Bleichenbacher/Marvin-style timing attacks
  • CVE-2025-49010: fix stack buffer overflow write in iso7816 GET RESPONSE
  • CVE-2025-66037: fix out-of-bounds heap read in sc_pkcs15_pubkey_from_spki_fields
  • CVE-2025-66038: fix buffer over-read in sc_compacttlv_find_tag
  • CVE-2025-66215: fix stack buffer overflow write in card-oberthur auth_compute_signature and auth_read_record
Record
CLSA-2026-1779190223
Updated
2026-11-02
OSVMGASA-2026-0224 No score

Updated opensc packages fix security vulnerabilities

CVE-2025-66038 Memory corruption via improper compact-TLV length validation CVE-2025-66215 Stack-buffer-overflow with physical access via crafted smart card or USB device CVE-2025-49010 Stack-buffer-overflow via crafted smart card or USB device responses CVE-2025-66037 Out-of-bounds read via crafted input CVE-2025-13763 Several uses of potentially uninitialized memory detected by fuzzers

Record
MGASA-2026-0224
Updated
2026-11-02
OSVopenSUSE-SU-2026:10475-1 No score

opensc-0.27.1-1.1 on GA media

These are all security issues fixed in the opensc-0.27.1-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:10475-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:20967-1 No score

Security update for opensc

This update for opensc fixes the following issues:

  • CVE-2025-49010: stack-buffer-overflow via crafted smart card or USB device responses (bsc#1261214).
  • CVE-2025-66037: crafted input can cause an out-of-bounds read (bsc#1261218).
  • CVE-2025-66038: improper compact-TLV length validation can lead to crash or unexpected behavior (bsc#1261219).
  • CVE-2025-66215: crafted smart card or USB device can cause a stack-buffer-overflow write (bsc#1261220).
Record
openSUSE-SU-2026:20967-1
Updated
2026-11-02
OSVSUSE-SU-2026:1477-1 No score

Security update for opensc

This update for opensc fixes the following issues:

  • CVE-2025-49010: specially crafted smart card or USB device can lead to a stack buffer overflow write in GET RESPONSE (bsc#1261214).
  • CVE-2025-66037: specially crafted input processed by the fuzz_pkcs15_reader harness can lead to an out-of-bounds heap read in the X.509/SPKI handling path (bsc#1261218).
  • CVE-2025-66038: improper compact-TLV length validation can lead to the dereferecing of out-of-bounds pointers and memory corruption (bsc#1261219).
  • CVE-2025-66215: specially crafted smart card or USB device can lead to a stack buffer overflow write in card-oberthur (bsc#1261220).
Record
SUSE-SU-2026:1477-1
Updated
2026-11-02
OSVSUSE-SU-2026:21283-1 No score

Security update for opensc

This update for opensc fixes the following issues:

  • CVE-2025-49010: stack-buffer-overflow via crafted smart card or USB device responses (bsc#1261214).
  • CVE-2025-66037: crafted input can cause an out-of-bounds read (bsc#1261218).
  • CVE-2025-66038: improper compact-TLV length validation can lead to crash or unexpected behavior (bsc#1261219).
  • CVE-2025-66215: crafted smart card or USB device can cause a stack-buffer-overflow write (bsc#1261220).
Record
SUSE-SU-2026:21283-1
Updated
2026-11-02
OSVSUSE-SU-2026:21320-1 No score

Security update for opensc

This update for opensc fixes the following issues:

  • CVE-2025-49010: stack-buffer-overflow via crafted smart card or USB device responses (bsc#1261214).
  • CVE-2025-66037: crafted input can cause an out-of-bounds read (bsc#1261218).
  • CVE-2025-66038: improper compact-TLV length validation can lead to crash or unexpected behavior (bsc#1261219).
  • CVE-2025-66215: crafted smart card or USB device can cause a stack-buffer-overflow write (bsc#1261220).
Record
SUSE-SU-2026:21320-1
Updated
2026-11-02
OSVSUSE-SU-2026:22114-1 No score

Security update for opensc

This update for opensc fixes the following issues:

  • CVE-2025-49010: stack-buffer-overflow via crafted smart card or USB device responses (bsc#1261214).
  • CVE-2025-66037: crafted input can cause an out-of-bounds read (bsc#1261218).
  • CVE-2025-66038: improper compact-TLV length validation can lead to crash or unexpected behavior (bsc#1261219).
  • CVE-2025-66215: crafted smart card or USB device can cause a stack-buffer-overflow write (bsc#1261220).
Record
SUSE-SU-2026:22114-1
Updated
2026-11-02
OSVSUSE-SU-2026:22126-1 No score

Security update for opensc

This update for opensc fixes the following issues:

  • CVE-2025-49010: stack-buffer-overflow via crafted smart card or USB device responses (bsc#1261214).
  • CVE-2025-66037: crafted input can cause an out-of-bounds read (bsc#1261218).
  • CVE-2025-66038: improper compact-TLV length validation can lead to crash or unexpected behavior (bsc#1261219).
  • CVE-2025-66215: crafted smart card or USB device can cause a stack-buffer-overflow write (bsc#1261220).
Record
SUSE-SU-2026:22126-1
Updated
2026-11-02
OSVSUSE-SU-2026:2657-1 No score

Security update for opensc

This update for opensc fixes the following issues

  • CVE-2025-49010: stack-buffer-overflow via crafted smart card or USB device responses (bsc#1261214).
  • CVE-2025-66037: crafted input can cause an out-of-bounds read (bsc#1261218).
  • CVE-2025-66038: improper compact-TLV length validation can lead to crash or unexpected behavior (bsc#1261219).
  • CVE-2025-66215: crafted smart card or USB device can cause a stack-buffer-overflow write (bsc#1261220).
  • CVE-2026-10275: global buffer overflow during key pair generation tests due to missing input validation (bsc#1267246).
  • CVE-2026-40528: stack and heap buffer overrun in the do_key_value() function due to missing length check allows for memory corruption via a crafted profile configuration file (bsc#1266963).
Record
SUSE-SU-2026:2657-1
Updated
2026-11-02
OSVSUSE-SU-2026:2697-1 No score

Security update for opensc

This update for opensc fixes the following issues

  • CVE-2025-49010: stack-buffer-overflow via crafted smart card or USB device responses (bsc#1261214).
  • CVE-2025-66037: crafted input can cause an out-of-bounds read (bsc#1261218).
  • CVE-2025-66038: improper compact-TLV length validation can lead to crash or unexpected behavior (bsc#1261219).
  • CVE-2025-66215: crafted smart card or USB device can cause a stack-buffer-overflow write (bsc#1261220).
  • CVE-2026-10275: global buffer overflow during key pair generation tests due to missing input validation (bsc#1267246).
  • CVE-2026-40528: stack and heap buffer overrun in the do_key_value() function due to missing length check allows for memory corruption via a crafted profile configuration file (bsc#1266963).
Record
SUSE-SU-2026:2697-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
opensc
Azure Linux:3
through 0.27.1-3 None known
opensc
Alpaquita:23
0.22.0-r4 up to 0.27.1-r0
0.27.1-r0
opensc
Alpaquita:25
0.26.0-r0 up to 0.27.1-r0
0.27.1-r0
opensc
Alpaquita:stream
0.22.0-r3 up to 0.27.1-r0
0.27.1-r0
opensc
TuxCare:AlmaLinux:9.2
From an advisory covering 5 CVEs
before 0.22.0-2.el9_2.tuxcare.els5
0.22.0-2.el9_2.tuxcare.els5
opensc
Debian:12
All versions, plus listed versions
0.23.0-0.30.23.0-0.3+deb12u10.23.0-0.3+deb12u20.23.0-10.23.0-2
Show 13 moreShow less
0.24.0~rc1-10.25.0~rc1-10.25.1-10.25.1-20.25.1-2.10.26.0-10.26.1-10.26.1-20.26.1-30.27.0~rc1-10.27.0~rc2-10.27.1-10.27.1-2
None known
opensc
Debian:13
All versions, plus listed versions
0.26.1-20.26.1-30.27.0~rc1-10.27.0~rc2-10.27.1-10.27.1-2
None known
opensc
Debian:14
before 0.27.0~rc1-1, plus listed versions
0.26.1-20.26.1-3
0.27.0~rc1-1
opensc
Mageia:9
From an advisory covering 5 CVEs
before 0.25.0-1.2.mga9
0.25.0-1.2.mga9
opensc
SUSE:Linux Enterprise Micro 5.2
From an advisory covering 4 CVEs
before 0.19.0-150100.3.34.1
0.19.0-150100.3.34.1
Show 27 moreShow less
Affected packages
PackageAffectedFixed
opensc
SUSE:Linux Micro 6.2
From an advisory covering 4 CVEs
before 0.26.1-160000.3.1
0.26.1-160000.3.1
opensc
SUSE:Linux Enterprise Server 16.0
From an advisory covering 4 CVEs
before 0.26.1-160000.3.1
0.26.1-160000.3.1
opensc
SUSE:Linux Enterprise Server for SAP applications 16.0
From an advisory covering 4 CVEs
before 0.26.1-160000.3.1
0.26.1-160000.3.1
opensc
SUSE:Linux Enterprise Micro 5.3
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise Micro 5.4
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise Micro 5.5
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise Server 15 SP4-LTSS
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise Server 15 SP5-LTSS
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise Server for SAP Applications 15 SP4
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise Server for SAP Applications 15 SP5
From an advisory covering 6 CVEs
before 0.22.0-150400.3.17.1
0.22.0-150400.3.17.1
opensc
SUSE:Linux Enterprise Module for Basesystem 15 SP7
From an advisory covering 6 CVEs
before 0.22.0-150600.11.11.1
0.22.0-150600.11.11.1
opensc
SUSE:Linux Enterprise Server 15 SP6-LTSS
From an advisory covering 6 CVEs
before 0.22.0-150600.11.11.1
0.22.0-150600.11.11.1
opensc
SUSE:Linux Enterprise Server for SAP Applications 15 SP6
From an advisory covering 6 CVEs
before 0.22.0-150600.11.11.1
0.22.0-150600.11.11.1
opensc
Ubuntu:Pro:16.04:LTS
All versions, plus listed versions
0.15.0-1ubuntu10.15.0-1ubuntu1+esm10.15.0-1ubuntu1+esm20.15.0-1ubuntu1+esm3
None known
opensc
Ubuntu:Pro:18.04:LTS
All versions, plus listed versions
0.17.0-10.17.0-20.17.0-2build10.17.0-30.17.0-3ubuntu0.1~esm10.17.0-3ubuntu0.1~esm20.17.0-3ubuntu0.1~esm3
None known
opensc
Ubuntu:Pro:20.04:LTS
All versions, plus listed versions
0.19.0-20.20.0-10.20.0-20.20.0-30.20.0-3ubuntu0.1~esm10.20.0-3ubuntu0.1~esm20.20.0-3ubuntu0.1~esm30.20.0-3ubuntu0.1~esm4
None known
opensc
Ubuntu:Pro:22.04:LTS
All versions, plus listed versions
0.21.0-1ubuntu10.22.0-1ubuntu20.22.0-1ubuntu2+esm10.22.0-1ubuntu2.10.22.0-1ubuntu2.1+esm1
None known
opensc
Ubuntu:Pro:24.04:LTS
All versions, plus listed versions
0.23.0-1ubuntu40.24.0~rc1-10.25.0~rc1-10.25.0~rc1-1build10.25.0~rc1-1build2
Show 4 moreShow less
0.25.0~rc1-1ubuntu0.1~esm10.25.0~rc1-1ubuntu0.10.25.0~rc1-1ubuntu0.20.25.0~rc1-1ubuntu0.2+esm1
None known
opensc
Ubuntu:25.10
All versions, plus listed versions
0.26.1-10.26.1-20.26.1-3
None known
opensc
Ubuntu:26.10
All versions, plus listed versions
0.27.0~rc1-10.27.1-20.27.1-2ubuntu10.27.1-2ubuntu2
None known
opensc
Ubuntu:26.04:LTS
All versions, plus listed versions
0.26.1-30.26.1-3ubuntu10.27.0~rc1-1
None known
opensc
openSUSE:Tumbleweed
From an advisory covering 5 CVEs
before 0.27.1-1.1
0.27.1-1.1
opensc
openSUSE:Leap 16.0
From an advisory covering 4 CVEs
before 0.26.1-160000.3.1
0.26.1-160000.3.1

History

History
RecordedChangedSources
affected
factsOSV
first indexedCVE List, EUVD, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2025-66038 is a low vulnerability (CVSS 3.9) in Opensc, published March 30, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.29%, the 22nd percentile. Fixed in opensc 0.27.1-r0.

References

Show 28 moreShow less
MoveEnter Open