Skip to main content

OpenSC CVE-2026-103531

| EUVDEUVD-2026-90449 MEDIUM
Stack-based Buffer Overflow (CWE-121)
2026-10-01 VulDB GHSA-m2qg-x6vj-xmrg
5.1
CVSS 4.0 · Vendor: VulDB
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker controls card file attributes
  2. Delivery
    Trigger setcos_construct_fci_44 on file creation
  3. Exploit
    Oversized type_attr copied to stack buffer
  4. Execution
    Stack-based buffer overflow
  5. Impact
    Process crash or memory corruption

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Stack buffer bounds checking
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires the SetCOS card driver code path in OpenSC to be exercised - specifically a file-creation operation that calls setcos_construct_fci_44 - with attacker-influenced file attribute data (type_attr, and per the full patch sec_attr/prop_attr) whose length exceeds the fixed stack buffer. In practice this means the attacker must supply or manipulate a SetCOS smart card or the sc_file_t attribute values processed locally by an OpenSC-based application; per the CVSS vector it needs PR:L and user interaction (UI:P), e.g. a user running the OpenSC tooling against the malicious card. The 'remote' characterization is not substantiated by the code path and limits realistic exploitation to scenarios involving physical/local card interaction. Only OpenSC builds using the SetCOS driver are affected.

Impact

This is a stack-based buffer overflow (CWE-121) in OpenSC's SetCOS card driver, specifically setcos_construct_fci_44() in src/libopensc/card-setcos.c, where attacker-influenced file attribute lengths (type_attr_len, and per the fuller patch sec_attr_len/prop_attr_len) are copied into a fixed-size stack buffer with no bounds check. The signals point to LOW real-world risk despite the 'remotely' claim. The vendor (VulDB) CVSS 4.0 vector AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:L scores 5.1 (medium), but VulDB routinely labels local/library-level flaws as 'remote,' and this is highly questionable: setcos_construct_fci_44 runs during file creation on a SetCOS smart card, so exploitation realistically requires a malicious or manipulated card (or local control over the sc_file_t attributes) rather than a network path - the AV:N is almost certainly inflated versus a true AV:L/AV:P exploitation surface (verify with vendor). No EPSS score, no CISA KEV listing, and no public proof-of-concept were provided; exploitation status is therefore no public exploit identified at time of analysis. The confirmed signal is that a vendor patch exists (OpenSC PR #3812, commit ad730304). The combination of PR:L, user interaction, a niche code path (SetCOS-specific driver), and only partial C/I/A impact makes this a low-priority, low-probability issue rather than an urgent one.

Exploit ScenarioDerived

An attacker supplies a malicious SetCOS smart card (or otherwise controls the file-attribute input) so that type_attr_len exceeds the fixed stack buffer in setcos_construct_fci_44; when the OpenSC-based application constructs the file control information during a card file-creation operation, the oversized attribute is copied onto the stack, overflowing it. This could crash the process or potentially corrupt stack memory in the context of the user running the OpenSC tooling. No public exploit code was identified, and the authentication/local-use prerequisites make opportunistic exploitation unlikely.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Oct 01, 2026

Stack-based buffer overflow in OpenSC's SetCOS smart-card driver (setcos_construct_fci_44 in src/libopensc/card-setcos.c) lets attacker-influenced file attribute data overwrite a fixed-size stack buffer during a file-creation operation. OpenSC builds through 0.27.1 that compile in the SetCOS driver are affected; per the assessed CVSS:3.1 vector (AV:L/PR:L/UI:R) this is a local, low-privilege issue that requires user interaction, such as a user running OpenSC tooling against a malicious or manipulated SetCOS card, with limited confidentiality, integrity and availability impact. Although the upstream fix is publicly visible as a GitHub commit and pull request, no public exploit code or confirmed active exploitation was identified at time of analysis.

RemediationAI

Apply the upstream fix identified as commit ad730304052937c32b4eb489a06835ac6123632c, delivered through pull request https://github.com/OpenSC/OpenSC/pull/3812, which adds bounds checks rejecting type_attr_len, sec_attr_len or prop_attr_len values larger than the destination stack buffer; because the fix landed as a PR/commit rather than a confirmed tagged release, remediation should be treated as 'upstream fix available (PR/commit); released patched version not independently confirmed', and administrators should either build from the patched commit or wait for the vendor release that incorporates it, then recompile and redeploy libopensc and any dependent applications. Where patching is not immediately possible, the most effective compensating control is to not load or to remove the SetCOS driver from the build/configuration (for example by disabling it at build time or restricting the card-driver list), accepting the trade-off that genuine SetCOS cards will no longer be usable through OpenSC; additionally, avoid running OpenSC tooling against untrusted or unfamiliar smart cards, constrain file-creation operations on untrusted cards, and run card operations as a low-privileged user so that a successful overflow yields only that user's privileges - noting that these measures reduce exposure but do not fix the underlying unchecked copy. Reference advisories: https://vuldb.com/vuln/412343, https://vuldb.com/vuln/412343/cti and https://vuldb.com/cve/CVE-2026-103531.

Affected VersionsENISA

opensc 0.27.0
opensc 0.27.1

Affected Packages

euvd opensc no fix

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 an open-source smart-card middleware stack that exposes cards through PKCS#11, minidriver and command-line tooling; card-specific behavior lives in drivers under src/libopensc, including card-setcos.c for the SetCOS card operating system. The vulnerable routine, setcos_construct_fci_44(), builds the File Control Information (FCI) descriptor used when a file is created on the card, packing variable-length attributes such as type_attr, sec_attr and prop_attr into a fixed-size stack buffer. The root cause is CWE-121 (stack-based buffer overflow): the attribute lengths (type_attr_len, sec_attr_len, prop_attr_len) are taken from the sc_file_t structure without validating them against sizeof(buf), so an oversized attribute is copied past the end of the stack buffer and can corrupt adjacent stack memory, including the return address. The upstream patch adds explicit guards that return SC_ERROR_INVALID_DATA when any of the three attribute lengths exceeds the buffer, which both confirms the affected code path and identifies the attacker-controlled inputs. Notably, the code path is driven by locally supplied card/file attribute data processed by the OpenSC library rather than by unsolicited network traffic, which is why the authoritative assessment rates the vector as local (AV:L) with user interaction (UI:R) despite the CVSS 4.0 vector supplied in the source data asserting AV:N/UI:P.

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

Vendor (VulDB) PRIMARY 5.1 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
vuln.today AI 4.8 MEDIUM

SetCOS file-creation code path driven by local/malicious-card input makes AV:L and UI:R appropriate; low-privilege local use (PR:L) with partial memory-corruption impact (C/I/A:L).

3.1 AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
4.0 AV:L/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
Red Hat 6.8 MEDIUM

Primary rating from Vendor (VulDB).

CVSS VectorVendor: VulDB

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

A flaw has been found in OpenSC up to 0.27.1. The impacted element is the function setcos_construct_fci_44 of the file src/libopensc/card-setcos.c. Executing a manipulation of the argument type_attr can lead to stack-based buffer overflow. The attack can be launched remotely. This patch is called ad730304052937c32b4eb489a06835ac6123632c. It is best practice to apply a patch to resolve this issue.

Threat Intelligence Overview

EPSS Score
0.2%
Top 92% exploitable
Prevalence
Medium
widely-used open-source smart-card library, shipped in many Linux distros
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment MSRC Vendor CIRCL 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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
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.

A stack-based buffer overflow occurs when a program writes more data to a buffer located on the stack than it was allocated to hold.

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