Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker controls card file attributes
-
DeliveryTrigger setcos_construct_fci_44 on file creation
-
ExploitOversized type_attr copied to stack buffer
-
ExecutionStack-based buffer overflow
-
ImpactProcess 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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).
Primary rating from Vendor (VulDB).
CVSS VectorVendor: VulDB
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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.
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
Several buffer overflows when handling responses from a Gemsafe V1 Smartcard in gemsafe_get_cert_len in libopensc/pkcs15
Several buffer overflows when handling responses from a TCOS Card in tcos_select_file in libopensc/card-tcos.c in OpenSC
Several buffer overflows when handling responses from a Muscle Card in muscle_list_files in libopensc/card-muscle.c in O
A double free when handling responses from an HSM Card in sc_pkcs15emu_sc_hsm_init in libopensc/pkcs15-sc-hsm.c in OpenS
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
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
A single byte buffer overflow when handling responses from an esteid Card in sc_pkcs15emu_esteid_init in libopensc/pkcs1
Several buffer overflows when handling responses from a CAC Card in cac_get_serial_nr_from_CUID in libopensc/card-cac.c
Several buffer overflows when handling responses from an ePass 2003 Card in decrypt_response in libopensc/card-epass2003
Several buffer overflows when handling responses from a Cryptoflex card in read_public_key in tools/cryptoflex-tool.c in
A buffer overflow when handling string concatenation in util_acl_to_str in tools/util.c in OpenSC before 0.19.0-rc1 coul
EUVD-2026-90449
GHSA-m2qg-x6vj-xmrg
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB