CVE-2026-40528: opensc_project opensc Stack-based Buffer Overflow
Vulnerability summary
CVE-2026-40528 is a high (CVSS 7.8) Stack-based Buffer Overflow vulnerability in opensc_project opensc. EPSS estimates a 0.15% chance of exploitation in the next 30 days, higher than 4.1% of scored vulnerabilities.
Advisory lineage
Upstream 0 · Downstream 7 · Related 6Timeline
- 29-05-2026PublishedVulnerability first disclosed.
- 14-07-2026Last modifiedVulnerability information updated.
Description
OpenSC before 0.27.0, fixed in commit 0358817, contains a stack and heap buffer overrun vulnerability in the do_key_value() function in src/pkcs15init/profile.c that allows attackers to corrupt memory by supplying a crafted profile configuration file. During pkcs15-init invocation, a key value entry beginning with '=' followed by more than sizeof(keybuf) characters is copied into keybuf via memcpy without a length check, causing both stack and heap buffer overruns.
CVSS metrics
4 scores · 2 sources · 2 versions- NVDNIST1.0LowCVSS:4.0/AV:P/AC:H/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- CVE.orgCNA3.8LowCVSS:3.1/AV:P/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:LDiffers
EPSS trend
Probability
0.15%
Chance of exploitation in the next 30 days
Percentile
4%
Versus all other CVEs
30-day change
+0.01 pp
From 0.15% on 19-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-121Stack-based Buffer OverflowA stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).
- CWE-122Heap-based Buffer OverflowA heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().
Affected systems
Opensc1 product
- opensc< 0.27.0 | < 0358817ec74aeca654f83e7709c7720b14c5db59
Opensc_project1 product
- opensc< 0.27.0
2 vendors · 2 products
References
3 links- www.vulncheck.com/advisories/opensc-buffer-overrun-in-do-key-value-via-profile-cThird Party Advisory