Skip to content
OpenAdvisories
Medium · 6.8 CVE-2026-40253 EUVD-2026-23318

openCryptoki: Memory safety vulnerabilities in BER/DER decoders in asn1.c

Published Apr 16, 2026 · Updated Apr 17, 2026 · Assigned by GitHub_M

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.

Affected products

VendorProductAffectedFixed
opencryptoki opencryptoki <= 3.26.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 opencryptoki 3.27.0-1 —
Debian 13 opencryptoki 3.23.0+dfsg-0.3+deb13u1 —
Debian 12 opencryptoki No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.04 LTS opencryptoki 3.26.0+dfsg-0ubuntu1.1 USN-8707-1
Ubuntu 25.10 opencryptoki No fix yet —
Ubuntu 24.04 LTS opencryptoki 3.23.0+dfsg-0ubuntu3.1 USN-8686-1
Ubuntu 22.04 LTS opencryptoki 3.17.0+dfsg+20220202.b40982e-0ubuntu1.3 USN-8686-1
Ubuntu 20.04 LTS opencryptoki No fix yet —
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 18.04 LTS opencryptoki No fix yet —
Ubuntu 16.04 LTS opencryptoki No fix yet —
ReleasePackageFixed inAdvisory
RHEL 10 opencryptoki +7 3.26.0-3.el10_2.1 RHSA-2026:28231
RHEL 9 opencryptoki +7 3.26.0-2.el9_8.2 RHSA-2026:28256
RHEL 8 opencryptoki +8 3.22.0-3.el8_10.3 RHSA-2026:26352
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
RHEL 10.0 EUS opencryptoki +7 3.24.0-6.el10_0.2 RHSA-2026:36697
RHEL 9.6 EUS opencryptoki +7 3.24.0-5.el9_6.2 RHSA-2026:36717
RHEL 9.4 E4S opencryptoki +6 3.22.0-3.el9_4.3 RHSA-2026:33519

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 10 opencryptoki +7 3.26.0-3.el10_2.1 ALSA-2026:28231
AlmaLinux 9 opencryptoki +7 3.26.0-2.el9_8.2 ALSA-2026:28256
AlmaLinux 8 opencryptoki +8 3.22.0-3.el8_10.3 ALSA-2026:26352

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 10 opencryptoki 3.26.0-3.el10_2.1 RLSA-2026:28231
Rocky Linux 9 opencryptoki 3.26.0-2.el9_8.2 RLSA-2026:28256
Rocky Linux 8 opencryptoki 3.22.0-3.el8_10.3 RLSA-2026:26352
ReleasePackageFixed inAdvisory
SLES 15 SP7 openCryptoki 3.26.0-150700.5.17.1 SUSE-SU-2026:2757-1
SLES 12 SP5 openCryptoki 3.17.0-5.24.1 SUSE-SU-2026:2685-2, SUSE-SU-2026:2685-1
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 16.0 openCryptoki 3.27.0-160000.1.1 SUSE-SU-2026:22365-1
SLES 16.0 openCryptoki 3.27.0-160000.1.1 SUSE-SU-2026:22365-1
SLE Micro 6.2 openCryptoki 3.27.0-160000.1.1 SUSE-SU-2026:22293-1
SLE Micro 5.4 openCryptoki 3.17.0-150400.4.16.1 SUSE-SU-2026:2355-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed openCryptoki 3.26.0-6.1 openSUSE-SU-2026:10593-1
openSUSE Leap 16.0 openCryptoki 3.27.0-160000.1.1 openSUSE-SU-2026:21059-1

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 opencryptoki No fix yet —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 10 opencryptoki +5 3.26.0-3.el10_2.1 ELSA-2026-28231
Oracle Linux 9 opencryptoki +5 3.26.0-2.el9_8.2 ELSA-2026-28256
Oracle Linux 8 opencryptoki +5 3.22.0-3.el8_10.3 ELSA-2026-26352

Advisories 26

References