CVE-2026-40253: openCryptoki: Memory safety vulnerabilities in BER/DER decoders in asn1.c
Last updated 1 September 2026
Other sources
openCryptoki is a PKCS#11 library and provides tooling for Linux and AIX. In versions 3.26.0 and below, the BER/DER decoding functions in the shared common library (asn1.c) accept a raw pointer but no buffer length parameter, and trust attacker-controlled BER length fields without validating them against actual buffer boundaries. All primitive decoders are affected: berdecodeINTEGER, berdecodeSEQUENCE, berdecodeOCTETSTRING, berdecodeBITSTRING, and berdecodeCHOICE. Additionally, berdecodeINTEGER can produce integer underflows when the encoded length is zero. An attacker supplying a malformed BER-encoded cryptographic object through PKCS#11 operations such as CCreateObject or CUnwrapKey, token loading from disk, or remote backend communication can trigger out-of-bounds reads. This affects all token backends (Soft, ICA, CCA, TPM, EP11, ICSF) since the vulnerable code is in the shared common library. A patch is available thorugh commit ed378f463ef73364c89feb0fc923f4dc867332a3.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/opencryptokito a version that resolves this vulnerability.Fixed in 3.27.0-1 - Upgrade
Upgrade
openCryptokito a version that resolves this vulnerability.Patch ed378f463ef73364c89feb0fc923f4dc867332a3 - Compensating control
Mitigate by preventing or restricting use of PKCS#11 operations that accept attacker-supplied malformed BER-encoded cryptographic objects (e.g., limit/validate inputs to C_CreateObject and C_UnwrapKey), including for token loading from disk and remote backend communication paths.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-40253?
CVE-2026-40253 has been classified as a memory safety vulnerability, which can lead to potential program crashes or exploitation.
How do I fix CVE-2026-40253?
To fix CVE-2026-40253, update to the latest version of openCryptoki that is higher than 3.26.0.
What software is affected by CVE-2026-40253?
CVE-2026-40253 affects openCryptoki versions 3.26.0 and below.
What are the implications of not addressing CVE-2026-40253?
Failing to address CVE-2026-40253 can result in potential security vulnerabilities, including crashes and unauthorized access.
Where can I find more information about CVE-2026-40253?
More information about CVE-2026-40253 can be found on the official GitHub advisories page for openCryptoki.