Vulnerability · Published Apr 16, 2026 · Assigned by GitHub_M

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

Medium 6.8

In plain English

A medium-severity out-of-bounds read in opencryptoki from opencryptoki. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 5% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)6.8Medium
Exploit odds (30 days)0.2%top 94.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:10opencryptoki3.26.0-3.el10_2.1ALSA-2026:28231
AlmaLinux:8opencryptoki3.22.0-3.el8_10.3ALSA-2026:26352
AlmaLinux:9opencryptoki3.26.0-2.el9_8.2ALSA-2026:28256
AlmaLinux:10opencryptoki-ccatok3.26.0-3.el10_2.1ALSA-2026:28231
AlmaLinux:8opencryptoki-ccatok3.22.0-3.el8_10.3ALSA-2026:26352
AlmaLinux:9opencryptoki-ccatok3.26.0-2.el9_8.2ALSA-2026:28256
AlmaLinux:10opencryptoki-devel3.26.0-3.el10_2.1ALSA-2026:28231
AlmaLinux:8opencryptoki-devel3.22.0-3.el8_10.3ALSA-2026:26352
AlmaLinux:9opencryptoki-devel3.26.0-2.el9_8.2ALSA-2026:28256
AlmaLinux:10opencryptoki-ep11tok3.26.0-3.el10_2.1ALSA-2026:28231
AlmaLinux:8opencryptoki-ep11tok3.22.0-3.el8_10.3ALSA-2026:26352
AlmaLinux:9opencryptoki-ep11tok3.26.0-2.el9_8.2ALSA-2026:28256
AlmaLinux:10opencryptoki-icatok3.26.0-3.el10_2.1ALSA-2026:28231
AlmaLinux:8opencryptoki-icatok3.22.0-3.el8_10.3ALSA-2026:26352
AlmaLinux:9opencryptoki-icatok3.26.0-2.el9_8.2ALSA-2026:28256
AlmaLinux:10opencryptoki-icsftok3.26.0-3.el10_2.1ALSA-2026:28231
AlmaLinux:8opencryptoki-icsftok3.22.0-3.el8_10.3ALSA-2026:26352
AlmaLinux:9opencryptoki-icsftok3.26.0-2.el9_8.2ALSA-2026:28256
AlmaLinux:10opencryptoki-libs3.26.0-3.el10_2.1ALSA-2026:28231
AlmaLinux:8opencryptoki-libs3.22.0-3.el8_10.3ALSA-2026:26352
AlmaLinux:9opencryptoki-libs3.26.0-2.el9_8.2ALSA-2026:28256
AlmaLinux:10opencryptoki-swtok3.26.0-3.el10_2.1ALSA-2026:28231
AlmaLinux:8opencryptoki-swtok3.22.0-3.el8_10.3ALSA-2026:26352
AlmaLinux:9opencryptoki-swtok3.26.0-2.el9_8.2ALSA-2026:28256
AlmaLinux:8opencryptoki-tpmtok3.22.0-3.el8_10.3ALSA-2026:26352
Debian:12opencryptokino fix listedDEBIAN-CVE-2026-40253
Debian:13opencryptoki3.23.0+dfsg-0.3+deb13u1DEBIAN-CVE-2026-40253
Debian:14opencryptoki3.27.0-1DEBIAN-CVE-2026-40253
Rocky Linux:10opencryptoki0:3.26.0-3.el10_2.1RLSA-2026:28231
Rocky Linux:8opencryptoki0:3.22.0-3.el8_10.3RLSA-2026:26352
Rocky Linux:9opencryptoki0:3.26.0-2.el9_8.2RLSA-2026:28256
Ubuntu:22.04:LTSopencryptoki3.17.0+dfsg+20220202.b40982e-0ubuntu1.3USN-8686-1
Ubuntu:22.04:LTSopencryptoki3.17.0+dfsg+20220202.b40982e-0ubuntu1.3UBUNTU-CVE-2026-40253
Ubuntu:24.04:LTSopencryptoki3.23.0+dfsg-0ubuntu3.1USN-8686-1
Ubuntu:24.04:LTSopencryptoki3.23.0+dfsg-0ubuntu3.1UBUNTU-CVE-2026-40253
Ubuntu:25.10opencryptokino fix listedUBUNTU-CVE-2026-40253
Ubuntu:26.04:LTSopencryptoki3.26.0+dfsg-0ubuntu1.1UBUNTU-CVE-2026-40253
Ubuntu:26.04:LTSopencryptoki3.26.0+dfsg-0ubuntu1.1USN-8707-1

Affected products (as reported)

VendorProductVersions
opencryptoki opencryptoki <= 3.26.0

Weakness: CWE-125 · Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H

References