OpenSC < 0.27.0 Buffer Overrun in do_key_value() via profile.c
Key facts
- Attack vector
- Physical
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- High
- Attack requirements
- None
- Impact type
- —
- Confidentiality · integrity · availability
- Low · Low · Low
- Fix status
- Partial Red Hat: 4 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and Red Hat.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
Remediation
- Fix · CNA OpenSC (OpenSC) Fixed in 0.27.0
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 10 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 7 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 8 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 9 | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-02 Threatist record created from CVE-2026-40528
- 2026-10-03 Alias added: GHSA-vxjj-52h8-95w5
More Opensc vulnerabilities
- TI-2025-40564 OpenSC: `sc_compacttlv_find_tag` can return out-of-bounds pointers CVSS 3.1MEDIUM 6.8
- TI-2025-40563 OpenSC: Out of Bounds vulnerability CVSS 3.1MEDIUM 6.8
- TI-2019-04558 sc_context_create in ctx.c in libopensc in OpenSC 0.19.0 has a memory leak, as demonstrated by a call from eidenv. CVSS 3.0HIGH 7.5
- TI-2021-13306 Stack overflow vulnerability in OpenSC smart card middleware before 0.23 via crafted responses to APDUs. CVSS 3.1HIGH 7.5
- TI-2019-12067 An issue was discovered in the pam_p11 component 0.2.0 and 0.3.0 for OpenSC. CVSS 3.0HIGH 7.5
- TI-2023-21453 Opensc: potential pin bypass when card tracks its own login state CVSS 3.1MEDIUM 6.6
Sources
- CVE-2026-40528 · CVE Program
- CVE-2026-40528 · NVD
- FIRST EPSS
- GHSA-vxjj-52h8-95w5 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-40528 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences