Skip to content

CVE-2026-40253 openCryptoki: Memory safety vulnerabilities in BER/DER decoders in asn1.c

MediumCVSS 6.1 EPSS 0.17%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: partial
Technology
OpenSSLUbuntuDebianRed Hat

Description

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: ber_decode_INTEGER, ber_decode_SEQUENCE, ber_decode_OCTET_STRING, ber_decode_BIT_STRING, and ber_decode_CHOICE. Additionally, ber_decode_INTEGER 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 C_CreateObject or C_UnwrapKey, 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.

Upgrade path

15 packages: 12 fixed, 2 with no fix yet.

PackageAffectedFixed inStatus
debian/opencryptoki(Debian 12) = 3.8.1+dfsg-3.2; = 3.23.0+dfsg-0.1; = 3.23.0+dfsg-0.2; = 3.23.0+dfsg-0.3 +3 more No fix listed No fix yet
redhat/opencryptoki(Red Hat rhel_els 7) All versions No fix listed No fix yet
debian/opencryptoki(Debian 13) < 3.23.0+dfsg-0.3+deb13u1; = 3.23.0+dfsg-0.3 3.23.0+dfsg-0.3+deb13u1 Fixed
debian/opencryptoki(Debian 14) < 3.27.0-1; = 3.23.0+dfsg-0.3; = 3.23.0+dfsg-0.4 3.27.0-1 Fixed
opencryptoki project opencryptoki <= 3.26.0 after 3.26.0 Fixed
redhat/opencryptoki(Red Hat enterprise_linux 10.2) < 3.26.0-3.el10_2.1 3.26.0-3.el10_2.1 Fixed
redhat/opencryptoki(Red Hat enterprise_linux 8) < 3.22.0-3.el8_10.3 3.22.0-3.el8_10.3 Fixed
redhat/opencryptoki(Red Hat enterprise_linux 9) < 3.26.0-2.el9_8.2 3.26.0-2.el9_8.2 Fixed
redhat/opencryptoki(Red Hat enterprise_linux_eus 10.0) < 3.24.0-6.el10_0.2 3.24.0-6.el10_0.2 Fixed
redhat/opencryptoki(Red Hat rhel_e4s 9.4) < 3.22.0-3.el9_4.3 3.22.0-3.el9_4.3 Fixed
redhat/opencryptoki(Red Hat rhel_eus 9.6) < 3.24.0-5.el9_6.2 3.24.0-5.el9_6.2 Fixed
ubuntu/opencryptoki(Ubuntu 22.04) < 3.17.0+dfsg+20220202.b40982e-0ubuntu1.3 3.17.0+dfsg+20220202.b40982e-0ubuntu1.3 Fixed
ubuntu/opencryptoki(Ubuntu 24.04) < 3.23.0+dfsg-0ubuntu3.1 3.23.0+dfsg-0ubuntu3.1 Fixed
ubuntu/opencryptoki(Ubuntu 26.04) < 3.26.0+dfsg-0ubuntu1.1 3.26.0+dfsg-0ubuntu1.1 Fixed
opencryptoki = <= 3.26.0 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
opencryptoki = <= 3.26.0 No fix listed
debian/opencryptoki(Debian:12) All versions No fix listed
debian/opencryptoki(Debian:12) = 3.23.0+dfsg-0.1 No fix listed
debian/opencryptoki(Debian:12) = 3.23.0+dfsg-0.2 No fix listed
debian/opencryptoki(Debian:12) = 3.23.0+dfsg-0.3 No fix listed
debian/opencryptoki(Debian:12) = 3.23.0+dfsg-0.4 No fix listed
debian/opencryptoki(Debian:12) = 3.27.0-1 No fix listed
debian/opencryptoki(Debian:12) = 3.8.1+dfsg-3.2 No fix listed
debian/opencryptoki(Debian:13) < 3.23.0+dfsg-0.3+deb13u1 3.23.0+dfsg-0.3+deb13u1
debian/opencryptoki(Debian:13) = 3.23.0+dfsg-0.3 No fix listed
debian/opencryptoki(Debian:14) < 3.27.0-1 3.27.0-1
debian/opencryptoki(Debian:14) = 3.23.0+dfsg-0.3 No fix listed
debian/opencryptoki(Debian:14) = 3.23.0+dfsg-0.4 No fix listed
redhat/opencryptoki(Red Hat:enterprise_linux:10.2) < 3.26.0-3.el10_2.1 3.26.0-3.el10_2.1
redhat/opencryptoki(Red Hat:enterprise_linux_eus:10.0) < 3.24.0-6.el10_0.2 3.24.0-6.el10_0.2
redhat/opencryptoki(Red Hat:enterprise_linux:8) < 3.22.0-3.el8_10.3 3.22.0-3.el8_10.3
redhat/opencryptoki(Red Hat:enterprise_linux:9) < 3.26.0-2.el9_8.2 3.26.0-2.el9_8.2
redhat/opencryptoki(Red Hat:rhel_e4s:9.4) < 3.22.0-3.el9_4.3 3.22.0-3.el9_4.3
redhat/opencryptoki(Red Hat:rhel_eus:9.6) < 3.24.0-5.el9_6.2 3.24.0-5.el9_6.2
redhat/opencryptoki(Red Hat:rhel_els:6) All versions No fix listed
redhat/opencryptoki(Red Hat:rhel_els:7) All versions No fix listed
ubuntu/opencryptoki(Ubuntu:22.04) < 3.17.0+dfsg+20220202.b40982e-0ubuntu1.3 3.17.0+dfsg+20220202.b40982e-0ubuntu1.3
ubuntu/opencryptoki(Ubuntu:24.04) < 3.23.0+dfsg-0ubuntu3.1 3.23.0+dfsg-0ubuntu3.1
ubuntu/opencryptoki(Ubuntu:26.04) < 3.26.0+dfsg-0ubuntu1.1 3.26.0+dfsg-0ubuntu1.1
opencryptoki project opencryptoki <= 3.26.0 No fix listed

References