Skip to main content

Opensc EUVDEUVD-2025-209127

| CVE-2025-66038 LOW
Buffer Over-read (CWE-126)
2026-03-30 GitHub_M
3.9
CVSS 3.1 · GitHub Advisory
View

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Buffer over-read prevention
Impact

The CVSS vector (AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L) indicates physical attack vector (smartcard proximity required) and high complexity, yielding a base score of 3.9. However, the actual risk is nuanced: while the low CVSS score reflects the physical barrier to exploitation, the vulnerability occurs when OpenSC processes untrusted data from smart cards or card-like sources, which is its primary operational context. The memory corruption potential (out-of-bounds reads/writes) could enable information disclosure or denial of service in environments where OpenSC interfaces with untrusted or compromised cards. The vulnerability is not actively exploited (no KEV status indicated), and no public exploit code exists at time of analysis, but the condition is easily triggered by malformed compact-TLV structures. The patch availability (version 0.27.0) and upstream fix via commit 6db171bcb6fd7cb3b51098fefbb3b28e44f0a79c reduce operational risk for patched deployments.

Exploit ScenarioDerived

An attacker with physical access to a card reader introduces a maliciously crafted smart card containing compact-TLV data with a tag element {0x0A} that claims a 10-byte value in a 1-byte buffer. When an OpenSC-based application (such as a PKI client or access control system) reads the card and calls sc_compacttlv_find_tag to search for tag 0x00, the function returns a pointer to buf+1 with outlen=10, causing subsequent code that dereferences this pointer to read or write beyond the buffer boundary. This could leak sensitive information from adjacent memory or corrupt application state. No public exploit code exists at time of analysis, but the vulnerability is trivially reproducible with a simple malformed TLV structure.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 30, 2026

OpenSC before version 0.27.0 contains an out-of-bounds buffer read vulnerability in the sc_compacttlv_find_tag function that can return pointers beyond the allocated buffer bounds, leading to potential memory corruption when downstream code dereferences the returned pointer. The vulnerability affects OpenSC when processing untrusted compact-TLV data from smart cards or files, where a maliciously crafted single-byte element can claim a length exceeding the remaining buffer size without validation. While the CVSS score of 3.9 reflects the physical attack vector requirement (smartcard interaction) and high attack complexity, the memory corruption potential poses a notable risk in environments where OpenSC processes untrusted card data.

RemediationAI

Vendor-released patch: OpenSC version 0.27.0 or later. Organizations using OpenSC should upgrade to 0.27.0 immediately, which includes the fix committed at 6db171bcb6fd7cb3b51098fefbb3b28e44f0a79c that adds proper bounds validation in sc_compacttlv_find_tag to ensure claimed value lengths do not exceed remaining buffer size. For systems unable to upgrade immediately, limit OpenSC exposure by restricting processing to trusted smart cards and avoiding untrusted card data sources where possible. Consult the vendor advisory at https://github.com/OpenSC/OpenSC/security/advisories/GHSA-72x5-fwjx-2459 for distribution-specific guidance and patch availability.

Affected VersionsENISA

opensc < 0.27.0

Affected Packages

euvd opensc fix: 0.27.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

OpenSC is middleware for smart card operations that handles Compact-TLV (Tag-Length-Value) encoded data, a format where a single byte encodes both the tag in the high nibble and value length in the low nibble. The sc_compacttlv_find_tag function is responsible for searching compact-TLV buffers for a specified tag. The root cause (CWE-126: Buffer Over-read) stems from inadequate bounds checking: when processing a buffer like {0x0A}, the function decodes this as tag=0x0 with claimed length=10 bytes, but returns a pointer (buf+1) without verifying that 10 bytes of data actually exist in the remaining buffer. This causes the function to return out-of-bounds pointers that, when dereferenced by calling code, can read from or corrupt memory beyond the intended buffer allocation.

Know when Opensc gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 3.9 LOW
AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
Red Hat 3.9 LOW

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Physical
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

Lifecycle Timeline

2
Patch available
Apr 16, 2026 - 05:29 EUVD
0.27.0
CVE Published
Mar 30, 2026 - 17:03 nvd
LOW 3.9

DescriptionGitHub Advisory

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 97% exploitable
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

20
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +20
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

More in Opensc

View all
CVE-2019-6502 HIGH POC
7.5 Jan 22

sc_context_create in ctx.c in libopensc in OpenSC 0.19.0 has a memory leak, as demonstrated by a call from eidenv. Rated

CVE-2018-16393 MEDIUM POC
6.8 Sep 03

Several buffer overflows when handling responses from a Gemsafe V1 Smartcard in gemsafe_get_cert_len in libopensc/pkcs15

CVE-2018-16392 MEDIUM POC
6.8 Sep 03

Several buffer overflows when handling responses from a TCOS Card in tcos_select_file in libopensc/card-tcos.c in OpenSC

CVE-2018-16391 MEDIUM POC
6.8 Sep 03

Several buffer overflows when handling responses from a Muscle Card in muscle_list_files in libopensc/card-muscle.c in O

CVE-2018-16425 MEDIUM POC
6.6 Sep 04

A double free when handling responses from an HSM Card in sc_pkcs15emu_sc_hsm_init in libopensc/pkcs15-sc-hsm.c in OpenS

CVE-2018-16424 MEDIUM POC
6.6 Sep 04

A double free when handling responses in read_file in tools/egk-tool.c (aka the eGK card tool) in OpenSC before 0.19.0-r

CVE-2018-16423 MEDIUM POC
6.6 Sep 04

A double free when handling responses from a smartcard in sc_file_set_sec_attr in libopensc/sc.c in OpenSC before 0.19.0

CVE-2018-16422 MEDIUM POC
6.6 Sep 04

A single byte buffer overflow when handling responses from an esteid Card in sc_pkcs15emu_esteid_init in libopensc/pkcs1

CVE-2018-16421 MEDIUM POC
6.6 Sep 04

Several buffer overflows when handling responses from a CAC Card in cac_get_serial_nr_from_CUID in libopensc/card-cac.c

CVE-2018-16420 MEDIUM POC
6.6 Sep 04

Several buffer overflows when handling responses from an ePass 2003 Card in decrypt_response in libopensc/card-epass2003

CVE-2018-16419 MEDIUM POC
6.6 Sep 04

Several buffer overflows when handling responses from a Cryptoflex card in read_public_key in tools/cryptoflex-tool.c in

CVE-2018-16418 MEDIUM POC
6.6 Sep 04

A buffer overflow when handling string concatenation in util_acl_to_str in tools/util.c in OpenSC before 0.19.0-rc1 coul

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy