# CVE-2026-40528: OpenSC < 0.27.0 Buffer Overrun in do_key_value() via profile.c

- Severity: Low 1.0 (CVSS:4.0, scored by VulnCheck) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 8% of CVEs (2026-12-01)
- Published: 2026-05-29T13:38:11.831Z
- Modified: 2026-07-21T12:10:00.090Z
- Weaknesses: CWE-121, CWE-122
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: VulnCheck

## 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.

(As written by CVE List.)

## Affected

- OpenSC OpenSC: before 0.27.0; before 0358817ec74aeca654f83e7709c7720b14c5db59
- opensc_project opensc: before 0.27.0

## Every score

- VulnCheck: 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`
- VulnCheck: 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`
- NVD: 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`

## References

- <https://github.com/OpenSC/OpenSC/commit/0358817ec74aeca654f83e7709c7720b14c5db59> (patch)
- <https://www.vulncheck.com/advisories/opensc-buffer-overrun-in-do-key-value-via-profile-c> (third-party-advisory)

## Sources

- CVE List: [CVE-2026-40528](https://www.cve.org/CVERecord?id=CVE-2026-40528), CVE Terms of Use, modified 2026-07-14
- NVD: [CVE-2026-40528](https://nvd.nist.gov/vuln/detail/CVE-2026-40528), Public domain, modified 2026-07-21

---

Page: https://cve.day/CVE-2026-40528 · Whole record: https://cve.day/CVE-2026-40528.json · Rebuilt by cve.day 2026-11-25T22:59:23.311Z
