{"schemaVersion":3,"id":"CVE-2026-40528","aliases":[],"status":"published","duplicateOf":null,"title":null,"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.","dates":{"published":"2026-05-29T13:38:11.831Z","modified":"2026-07-14T20:00:40.951Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":7.8,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"4.0","versionLabel":"v4.0","source":"CVE.org","score":1,"severity":"low","vector":"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","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":3.8,"severity":"low","vector":"CVSS:3.1/AV:P/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L","exploitability":null,"impact":null,"computed":false},{"version":"4.0","versionLabel":"v4.0","source":"NVD","score":1,"severity":"low","vector":"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","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":7.8,"severity":"high","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00154,"percentile":0.04125,"severity":"low","asOf":"2026-10-19T00:00:00.000Z","change":{"pp":0.008,"baselineDate":"2026-09-19T00:00:00.000Z","baselineScore":0.00146},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00154,"percentile":0.04125}],"last30":[{"date":"2026-09-19T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00146,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00154,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00154,"percentile":0.04125}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-121","name":"Stack-based Buffer Overflow","description":"A 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).","type":"weakness","status":"Draft","abstraction":"Variant","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/121.html"},{"id":"CWE-122","name":"Heap-based Buffer Overflow","description":"A 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().","type":"weakness","status":"Draft","abstraction":"Variant","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/122.html"}],"affected":[{"vendor":"opensc_project","product":"opensc","name":"opensc","label":"opensc","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 0.27.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 0.27.0","eol":null,"hubHref":"/vendor/opensc_project/opensc"},{"vendor":"opensc","product":"opensc","name":"OpenSC","label":"opensc","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 0.27.0","noFixRecorded":false,"fixedIn":null},{"text":"< 0358817ec74aeca654f83e7709c7720b14c5db59","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 0.27.0 | < 0358817ec74aeca654f83e7709c7720b14c5db59","eol":null,"hubHref":"/vendor/opensc/opensc"}],"affectedCount":2,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/OpenSC/OpenSC/commit/0358817ec74aeca654f83e7709c7720b14c5db59","label":"github.com/OpenSC/OpenSC/commit/0358817ec74aeca654f83e7709c7720b14c5db59","hostname":"github.com","tags":["Patch"]},{"url":"https://www.vulncheck.com/advisories/opensc-buffer-overrun-in-do-key-value-via-profile-c","label":"www.vulncheck.com/advisories/opensc-buffer-overrun-in-do-key-value-via-profile-c","hostname":"www.vulncheck.com","tags":["Third Party Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40528","label":"nvd.nist.gov/vuln/detail/CVE-2026-40528","hostname":"nvd.nist.gov","tags":["Oval","Advisory"]}],"lineage":{"upstream":[],"downstream":["MGASA-2026-0231","OPENSUSE-SU-2026:11022-1","OPENSUSE-SU-2026:21873-1","SUSE-SU-2026:22103-1","SUSE-SU-2026:22139-1","SUSE-SU-2026:2657-1","SUSE-SU-2026:2697-1"],"duplicates":[],"related":["OPENSUSE-SU-2026:11022-1","OPENSUSE-SU-2026:21873-1","SUSE-SU-2026:22103-1","SUSE-SU-2026:22139-1","SUSE-SU-2026:2657-1","SUSE-SU-2026:2697-1"]},"timeline":[{"kind":"published","date":"2026-05-29T13:38:11.831Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2026-07-14T20:00:40.951Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":31,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T04:22:52.573Z","stale":false,"partial":false}}