OpenSC before 0.27.0, fixed in commit 0358817, contains a stack and heap buffer overrun vulnerability in the dokeyvalue() 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.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40528.json",
"cna_assigner": "VulnCheck",
"cwe_ids": [
"CWE-121",
"CWE-122"
],
"unresolved_ranges": [
{
"source": "AFFECTED_FIELD",
"extracted_events": [
{
"fixed": "0358817ec74aeca654f83e7709c7720b14c5db59"
}
]
}
]
}{
"cpe": "cpe:2.3:a:opensc_project:opensc:*:*:*:*:*:*:*:*",
"source": [
"CPE_RANGE",
"REFERENCES"
],
"extracted_events": [
{
"introduced": "0"
},
{
"fixed": "0.27.0"
}
]
}"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-40528.json"
"2026-07-23T08:16:33Z"
[
{
"digest": {
"function_hash": "232499657068621503282061430363004536380",
"length": 486.0
},
"source": "https://github.com/opensc/opensc/commit/0358817ec74aeca654f83e7709c7720b14c5db59",
"signature_type": "Function",
"signature_version": "v1",
"id": "CVE-2026-40528-7e3ed371",
"target": {
"file": "src/pkcs15init/profile.c",
"function": "do_key_value"
},
"deprecated": false
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"283131138558317224907081810785318560356",
"278373350958975542287068350372565494830",
"67470242920721080506956144928293937423",
"196511876688390407994760463384734803440"
]
},
"source": "https://github.com/opensc/opensc/commit/0358817ec74aeca654f83e7709c7720b14c5db59",
"signature_type": "Line",
"signature_version": "v1",
"id": "CVE-2026-40528-dc7e572f",
"target": {
"file": "src/pkcs15init/profile.c"
},
"deprecated": false
}
]