
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-40253 is an out-of-bounds read vulnerability in openCryptoki's BER/DER decoding functions located in usr/lib/common/asn1.c. It affects all versions of openCryptoki up to and including v3.26.0, impacting all token backends (Soft, ICA, CCA, TPM, EP11, ICSF) since the vulnerable code resides in the shared common library. The vulnerability was published on April 16, 2026, and a fix was released in v3.27.0. It carries a CVSS v3.1 base score of 6.8 (Medium) per the GitHub Security Advisory, with an alternate score of 6.1 (Medium) per NVD (GitHub Advisory, Red Hat Bugzilla).
The root cause (CWE-125: Out-of-Bounds Read) is that all five primitive BER decoder functions — ber_decode_INTEGER, ber_decode_SEQUENCE, ber_decode_OCTET_STRING, ber_decode_BIT_STRING, and ber_decode_CHOICE — accept a raw pointer with no buffer length parameter, blindly trusting the attacker-controlled BER-encoded length field without validating it against actual buffer boundaries. Additionally, ber_decode_INTEGER can produce integer underflows (CWE-191) when the encoded length is zero, causing data_len = len - 1 to wrap to CK_ULONG_MAX. The attack vector is local, requiring no privileges, and can be triggered by supplying a malformed BER-encoded cryptographic object through PKCS#11 operations (C_CreateObject, C_UnwrapKey), token objects loaded from disk (loadsave.c), or objects received from remote ICSF/EP11 backends. A complete proof-of-concept (poc_ber_decode.c) with 8 test cases demonstrating crashes and OOB reads detectable by AddressSanitizer is publicly available (GitHub Advisory, Patch Commit).
Successful exploitation can result in information disclosure of sensitive heap memory contents (e.g., cryptographic key material or other process memory) and denial of service via process crash. Because the vulnerable code is in the shared common library, all token backends are equally affected, broadening the attack surface across any deployment using openCryptoki on Linux or AIX. There is no integrity impact, but the combination of memory disclosure and availability loss is particularly concerning in cryptographic infrastructure contexts where key confidentiality is paramount (GitHub Advisory, Red Hat Bugzilla).
A complete, runnable proof-of-concept (poc_ber_decode.c) is publicly available in the GitHub Security Advisory, demonstrating 8 test cases that trigger memory safety bugs via direct calls to the vulnerable decoder functions with heap-allocated malformed payloads, confirmed by AddressSanitizer. There is no evidence of in-the-wild exploitation at this time, and the vulnerability is not listed in the CISA KEV catalog. The EPSS score is approximately 0.012% (0.000120), indicating a low probability of exploitation in the near term (GitHub Advisory, Feedly).
02 7F 41) for an INTEGER, or use long-form encoding (30 81 FF 00) for a SEQUENCE with claimed length 255.C_CreateObject or C_UnwrapKey with the crafted BER-encoded key or certificate attribute.loadsave.c on next token initialization.ber_decode_INTEGER, supply a zero-length encoding (e.g., 02 00 00) to cause data_len = 0 - 1 = CK_ULONG_MAX, enabling subsequent out-of-bounds memory access.data_len without bounds validation; any caller that subsequently uses data_len for a memcpy or memory read will access heap memory beyond the allocated buffer, potentially leaking sensitive data or crashing the process (GitHub Advisory).pkcsslotd) or PKCS#11-consuming applications; AddressSanitizer reports referencing asn1.c functions (ber_decode_INTEGER, ber_decode_SEQUENCE, ber_decode_OCTET_STRING, ber_decode_BIT_STRING) in stack traces./var/lib/opencryptoki/) with anomalous BER-encoded content; newly placed or modified token files with oversized length fields in TLV structures.libopencryptoki or libpkcs11; core dumps from pkcsslotd or HSM-interfacing daemons; unusual memory access patterns detected by system-level memory protection tools (e.g., ASAN, Valgrind output in debug environments).Upgrade openCryptoki to v3.27.0 or apply the fix introduced in commit ed378f463ef73364c89feb0fc923f4dc867332a3, which adds a buf_len parameter to all affected BER decoder functions and validates header_size + len <= buf_len before proceeding. As a workaround, restrict access to PKCS#11 operations and token object files to trusted users and processes only, and avoid processing cryptographic objects from untrusted sources. SUSE has released updated packages addressing this vulnerability (SUSE-SU-2026:2355-1 and related advisories) (Patch Commit, GitHub Advisory, SUSE Advisory).
The vulnerability was discovered and reported by security researcher Sebastian Josue Alba Vives (handle: 0xS4bb1), who provided a detailed PoC and coordinated disclosure through the openCryptoki GitHub Security Advisory. Red Hat tracked the issue via Bugzilla (Bug 2459076) and classified it as medium severity. SUSE issued multiple security update announcements for affected openSUSE and SUSE Linux Enterprise packages. Coverage appeared on Linux security news aggregators including linuxsecurity.com and pro-linux.de (GitHub Advisory, Red Hat Bugzilla, SUSE Advisory).
Fix availability across major Linux distributions and their releases.
bookworm
opencryptoki
sid
opencryptoki: 3.27.0-1
trixie
opencryptoki: 3.23.0+dfsg-0.3+deb13u1
bionic (esm-apps)
opencryptoki
devel
opencryptoki
focal (esm-apps)
opencryptoki
jammy
opencryptoki: 3.17.0+dfsg+20220202.b40982e-0ubuntu1.3
jammy (esm-apps)
opencryptoki: 3.17.0+dfsg+20220202.b40982e-0ubuntu1.3
noble
opencryptoki: 3.23.0+dfsg-0ubuntu3.1
noble (esm-apps)
opencryptoki: 3.23.0+dfsg-0ubuntu3.1
resolute
opencryptoki: 3.26.0+dfsg-0ubuntu1.1
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."