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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:10 | opencryptoki | 3.26.0-3.el10_2.1 | ALSA-2026:28231 |
| AlmaLinux:8 | opencryptoki | 3.22.0-3.el8_10.3 | ALSA-2026:26352 |
| AlmaLinux:9 | opencryptoki | 3.26.0-2.el9_8.2 | ALSA-2026:28256 |
| AlmaLinux:10 | opencryptoki-ccatok | 3.26.0-3.el10_2.1 | ALSA-2026:28231 |
| AlmaLinux:8 | opencryptoki-ccatok | 3.22.0-3.el8_10.3 | ALSA-2026:26352 |
| AlmaLinux:9 | opencryptoki-ccatok | 3.26.0-2.el9_8.2 | ALSA-2026:28256 |
| AlmaLinux:10 | opencryptoki-devel | 3.26.0-3.el10_2.1 | ALSA-2026:28231 |
| AlmaLinux:8 | opencryptoki-devel | 3.22.0-3.el8_10.3 | ALSA-2026:26352 |
| AlmaLinux:9 | opencryptoki-devel | 3.26.0-2.el9_8.2 | ALSA-2026:28256 |
| AlmaLinux:10 | opencryptoki-ep11tok | 3.26.0-3.el10_2.1 | ALSA-2026:28231 |
| AlmaLinux:8 | opencryptoki-ep11tok | 3.22.0-3.el8_10.3 | ALSA-2026:26352 |
| AlmaLinux:9 | opencryptoki-ep11tok | 3.26.0-2.el9_8.2 | ALSA-2026:28256 |
| AlmaLinux:10 | opencryptoki-icatok | 3.26.0-3.el10_2.1 | ALSA-2026:28231 |
| AlmaLinux:8 | opencryptoki-icatok | 3.22.0-3.el8_10.3 | ALSA-2026:26352 |
| AlmaLinux:9 | opencryptoki-icatok | 3.26.0-2.el9_8.2 | ALSA-2026:28256 |
| AlmaLinux:10 | opencryptoki-icsftok | 3.26.0-3.el10_2.1 | ALSA-2026:28231 |
| AlmaLinux:8 | opencryptoki-icsftok | 3.22.0-3.el8_10.3 | ALSA-2026:26352 |
| AlmaLinux:9 | opencryptoki-icsftok | 3.26.0-2.el9_8.2 | ALSA-2026:28256 |
| AlmaLinux:10 | opencryptoki-libs | 3.26.0-3.el10_2.1 | ALSA-2026:28231 |
| AlmaLinux:8 | opencryptoki-libs | 3.22.0-3.el8_10.3 | ALSA-2026:26352 |
| AlmaLinux:9 | opencryptoki-libs | 3.26.0-2.el9_8.2 | ALSA-2026:28256 |
| AlmaLinux:10 | opencryptoki-swtok | 3.26.0-3.el10_2.1 | ALSA-2026:28231 |
| AlmaLinux:8 | opencryptoki-swtok | 3.22.0-3.el8_10.3 | ALSA-2026:26352 |
| AlmaLinux:9 | opencryptoki-swtok | 3.26.0-2.el9_8.2 | ALSA-2026:28256 |
| AlmaLinux:8 | opencryptoki-tpmtok | 3.22.0-3.el8_10.3 | ALSA-2026:26352 |
| Debian:12 | opencryptoki | no fix listed | DEBIAN-CVE-2026-40253 |
| Debian:13 | opencryptoki | 3.23.0+dfsg-0.3+deb13u1 | DEBIAN-CVE-2026-40253 |
| Debian:14 | opencryptoki | 3.27.0-1 | DEBIAN-CVE-2026-40253 |
| Rocky Linux:10 | opencryptoki | 0:3.26.0-3.el10_2.1 | RLSA-2026:28231 |
| Rocky Linux:8 | opencryptoki | 0:3.22.0-3.el8_10.3 | RLSA-2026:26352 |
| Rocky Linux:9 | opencryptoki | 0:3.26.0-2.el9_8.2 | RLSA-2026:28256 |
| Ubuntu:22.04:LTS | opencryptoki | 3.17.0+dfsg+20220202.b40982e-0ubuntu1.3 | USN-8686-1 |
| Ubuntu:22.04:LTS | opencryptoki | 3.17.0+dfsg+20220202.b40982e-0ubuntu1.3 | UBUNTU-CVE-2026-40253 |
| Ubuntu:24.04:LTS | opencryptoki | 3.23.0+dfsg-0ubuntu3.1 | USN-8686-1 |
| Ubuntu:24.04:LTS | opencryptoki | 3.23.0+dfsg-0ubuntu3.1 | UBUNTU-CVE-2026-40253 |
| Ubuntu:25.10 | opencryptoki | no fix listed | UBUNTU-CVE-2026-40253 |
| Ubuntu:26.04:LTS | opencryptoki | 3.26.0+dfsg-0ubuntu1.1 | UBUNTU-CVE-2026-40253 |
| Ubuntu:26.04:LTS | opencryptoki | 3.26.0+dfsg-0ubuntu1.1 | USN-8707-1 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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