CVE-2026-40528
OpenSC < 0.27.0 Buffer Overrun in do_key_value() via profile.c
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.
Attack profile
How easy it is to exploit
- Attack vector
- Physical
- Complexity
- High
- Privileges needed
- None
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
1.0
OpenSC < 0.27.0 Buffer Overrun in do_key_value() via profile.c
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.
- Record
CVE-2026-40528- CVSS 4.0
- 1.0 Low
CVSS:4.0/AV:P/AC:H/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N - CVSS 3.1
- 3.8 Low
CVSS:3.1/AV:P/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L - Weakness
- CWE-121, CWE-122
- Updated
- 2026-11-02
EUVDEUVD-2026-33320
1.0
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.
- Record
EUVD-2026-33320- CVSS 4.0
- 1.0 Low
CVSS:4.0/AV:P/AC:H/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-vxjj-52h8-95w5
1.0
OpenSC before 0.27.0, fixed in commit 0358817, contains a stack and heap buffer overrun...
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.
- Record
GHSA-vxjj-52h8-95w5- CVSS 4.0
- 1.0 Low
CVSS: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 - CVSS 3.1
- 3.8 Low
CVSS:3.1/AV:P/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L - Weakness
- CWE-121
- Updated
- 2026-11-02
NVD
1.0
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.
- Record
CVE-2026-40528- CVSS 4.0
- 1.0 Low
CVSS: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 - CVSS 3.1
- 3.8 Low
CVSS:3.1/AV:P/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-121, CWE-122
- Updated
- 2026-11-02
OSV
1.0
OpenSC < 0.27.0 Buffer Overrun in do_key_value() via profile.c
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.
- Record
CVE-2026-40528- CVSS 4.0
- 1.0 Low
CVSS:4.0/AV:P/AC:H/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N - Weakness
- CWE-121, CWE-122
- Updated
- 2026-11-02
OSVAZL-89147 No score
CVE-2026-40528 affecting package opensc for versions less than 0.27.0-1
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.
- Record
AZL-89147- Updated
- 2026-11-02
Show 9 moreShow less
OSVCLSA-2026-1780711381 No score
opensc: Fix of 2 CVEs
- CVE-2026-40510: stack buffer overflow in piv_process_history() via crafted PIV Key History Object
- CVE-2026-40528: stack/heap buffer overrun in do_key_value() via overlong pkcs15init profile key value
- Record
CLSA-2026-1780711381- Updated
- 2026-11-02
OSVCLSA-2026-1781088266 No score
opensc: Fix of CVE-2026-40528
- CVE-2026-40528: avoid possible buffer overrun when parsing pkcs15-init profile key values
- Record
CLSA-2026-1781088266- Updated
- 2026-11-02
OSVMGASA-2026-0231 No score
Updated opensc packages fix security vulnerabilities
These packages fix security vulnerabilities: CVE-2026-10275, A flaw has been found in OpenSC up to 0.26.1. This affects the function test_kpgen_certwrite of the file src/tools/pkcs11-tool.c of the component pkcs11-tool Key Generation Module. This manipulation causes buffer overflow. The attack is possible to be carried out remotely. The complexity of an attack is rather high. It is indicated that the exploitability is difficult. The exploit has been published and may be used. Patch name: 814f745b3b6d100295f65f1935edd33d520d33ab. It is recommended to apply a patch to fix this issue. CVE-2026-40528, 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.
- Record
MGASA-2026-0231- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11022-1 No score
opensc-0.27.1-2.1 on GA media
These are all security issues fixed in the opensc-0.27.1-2.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11022-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:21873-1 No score
Security update for opensc
This update for opensc fixes the following issues:
- 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
openSUSE-SU-2026:21873-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:22103-1 No score
Security update for opensc
This update for opensc fixes the following issues
- 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:22103-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:22139-1 No score
Security update for opensc
This update for opensc fixes the following issues
- 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:22139-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
| Package | Affected | Fixed |
|---|---|---|
openscAzure Linux:3 |
before 0.27.0-1 | 0.27.0-1 |
openscTuxCare:AlmaLinux:9.2 From an advisory covering 2 CVEs |
before 0.22.0-2.el9_2.tuxcare.els8 | 0.22.0-2.el9_2.tuxcare.els8 |
openscTuxCare:AlmaLinux:9.6 |
before 0.23.0-5.el9.tuxcare.els4 | 0.23.0-5.el9.tuxcare.els4 |
openscMageia:9 From an advisory covering 2 CVEs |
before 0.25.0-1.3.mga9 | 0.25.0-1.3.mga9 |
openscSUSE:Linux Micro 6.0 From an advisory covering 2 CVEs |
before 0.24.0-6.1 | 0.24.0-6.1 |
openscSUSE:Linux Micro 6.1 From an advisory covering 2 CVEs |
before 0.24.0-slfo.1.1_4.1 | 0.24.0-slfo.1.1_4.1 |
openscSUSE: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 |
openscSUSE: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 |
openscSUSE: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 |
openscSUSE: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 |
Show 12 moreShow less
| Package | Affected | Fixed |
|---|---|---|
openscSUSE: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 |
openscSUSE: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 |
openscSUSE: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 |
openscSUSE: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 |
openscSUSE: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 |
openscSUSE: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 |
openscSUSE: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 |
openscSUSE: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 |
openscSUSE: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 |
openscSUSE: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 |
openscopenSUSE:Tumbleweed From an advisory covering 2 CVEs |
before 0.27.1-2.1 | 0.27.1-2.1 |
openscopenSUSE:Leap 16.0 From an advisory covering 2 CVEs |
before 0.26.1-160000.5.1 | 0.26.1-160000.5.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-40528 is a low vulnerability (CVSS 1.0) in Opensc, published May 29, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.19%, the 8th percentile. Fixed in opensc 0.27.0-1.
References
github.com/OpenSC/OpenSC/commit/0358817ec74aeca654f83e7709c7720b14c5db59
vulncheck.com/advisories/opensc-buffer-overrun-in-do-key-value-via-profile-c
nvd.nist.gov/vuln/detail/CVE-2026-40528
github.com/advisories/GHSA-vxjj-52h8-95w5
errata.tuxcare.com/els_os/almalinux9.2esu/CLSA-2026-1780711381.html
nvd.nist.gov/vuln/detail/CVE-2026-40510
Show 23 moreShow less
errata.tuxcare.com/els_os/tuxcare9.6esu/CLSA-2026-1781088266.html
github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40528.json
github.com/OpenSC/OpenSC
advisories.mageia.org/MGASA-2026-0231.html
bugs.mageia.org/show_bug.cgi?id=35710
lists.opensuse.org/archives/list/[email protected]/message/BXWQZWIKO7R5XJCNG2QJKDJX4QJMW4G5
github.com/OpenSC/OpenSC/issues/3682
suse.com/support/update/announcement/2026/suse-su-202622103-1
bugzilla.suse.com/1266963
bugzilla.suse.com/1267246
suse.com/security/cve/CVE-2026-10275
suse.com/security/cve/CVE-2026-40528
suse.com/support/update/announcement/2026/suse-su-202622139-1
suse.com/support/update/announcement/2026/suse-su-20262657-1
bugzilla.suse.com/1261214
bugzilla.suse.com/1261218
bugzilla.suse.com/1261219
bugzilla.suse.com/1261220
suse.com/security/cve/CVE-2025-49010
suse.com/security/cve/CVE-2025-66037
suse.com/security/cve/CVE-2025-66038
suse.com/security/cve/CVE-2025-66215
suse.com/support/update/announcement/2026/suse-su-20262697-1