CVE-2026-40528 OpenSC < 0.27.0 Buffer Overrun in do_key_value() via profile.c
Attackers can corrupt memory and potentially execute code by supplying a crafted profile configuration file to OpenSC during pkcs15-init invocation.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-40528?
CVE-2026-40528 is a low-severity memory corruption vulnerability in Opensc Project Opensc, published on 29 May 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official 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.
Which versions are affected by CVE-2026-40528?
It affects 1 product.
Products include Opensc Project Opensc.
How do I fix CVE-2026-40528?
Apply the vendor's patch.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2026-40528 being exploited?
There is no known exploitation of CVE-2026-40528 in the wild and no public exploit code.
Other vulnerabilities in Opensc Project Opensc
Sources
Also known as AZL-89147, CLSA-2026-1781088266, GHSA-vxjj-52h8-95w5.