Skip to main content

openCryptoki EUVDEUVD-2026-23318

| CVE-2026-40253 MEDIUM
Out-of-bounds Read (CWE-125)
2026-04-16 GitHub_M
6.8
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain local process access or token file write access
  2. Delivery
    Craft malformed BER-encoded cryptographic object with oversized length field
  3. Exploit
    Submit via C_CreateObject, C_UnwrapKey, or token file load
  4. Execution
    ber_decode_* trusts attacker-supplied length without buffer-bound check
  5. Impact
    Out-of-bounds heap read leaks adjacent memory or crashes PKCS#11 daemon

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK

1 technique across 1 tactic: Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires delivering a malformed BER-encoded cryptographic object through one of four specific paths: (1) invoking PKCS#11 API calls C_CreateObject or C_UnwrapKey as a local process with access to the openCryptoki library - the CVSS vector PR:N suggests any local process can call these functions without elevated privileges; (2) writing or replacing a token file on disk in the openCryptoki token storage directory, which is parsed during daemon startup without live attacker PKCS#11 authentication; (3) sending malformed BER data through a remote backend communication channel, applicable when the ICSF backend is configured. Exploitation is not possible on systems where openCryptoki is not installed or where no token backends are active. The non-automatable SSVC finding and AV:L CVSS vector confirm that mass scanning-style exploitation is not viable - an attacker must have local access or file-write capability, or interact with an ICSF-enabled backend. Exploitation via the disk-loading path requires write access to token storage (typically elevated), which limits that vector relative to the API-invocation path.

Impact

The CVSS 3.1 score of 6.8 (AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H) reflects a local attack vector with no privilege requirement, high availability impact, and limited confidentiality exposure. The EPSS of 0.01% (2nd percentile) and SSVC Automatable:no together indicate mass automated exploitation is unlikely - the attack requires deliberate crafting of malformed BER structures and delivery through a specific PKCS#11 pathway. However, SSVC confirms POC code exists (Exploitation:poc), which lowers the skill barrier for targeted attacks in environments where openCryptoki is deployed. The token-file-loading path is notable: a malformed file on disk can trigger the OOB read during daemon initialization without live attacker interaction, broadening the attack surface beyond interactive PKCS#11 sessions. The CVSS availability impact of High is the primary urgency driver for environments where cryptographic service continuity is operationally critical (HSM-dependent workloads, key management infrastructure). The confidentiality impact (Low) reflects that OOB reads can leak adjacent heap memory but are not confirmed to enable targeted key material extraction. No CISA KEV listing means active exploitation in the wild is not confirmed; the low EPSS despite POC existence is consistent with SSVC's characterization of partial technical impact and non-automatable exploitation.

Exploit ScenarioDerived

A local user process linked against openCryptoki constructs a crafted BER-encoded INTEGER or OCTET_STRING where the BER length field claims a size far exceeding the actual allocation and calls C_CreateObject to submit it; ber_decode_INTEGER or ber_decode_OCTET_STRING reads past the buffer boundary, leaking heap memory adjacent to the decoded object or crashing the PKCS#11 daemon. Alternatively, an attacker with write access to the token storage directory plants a malformed token file; when the openCryptoki daemon initializes and loads the token, the same OOB read fires without any PKCS#11 API interaction. Proof-of-concept code exists per SSVC classification, reducing the technical barrier for either scenario.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 24, 2026

Out-of-bounds reads in openCryptoki's BER/DER decoding layer expose Linux and AIX systems to cryptographic service disruption and limited memory disclosure across all token backends. All five primitive decoders in the shared asn1.c library lack buffer-length parameters, accepting attacker-controlled BER length fields without validating them against actual buffer boundaries - a condition reachable via PKCS#11 API operations (C_CreateObject, C_UnwrapKey), token file loading from disk, or remote backend channels (ICSF). Proof-of-concept code exists per SSVC classification, though EPSS sits at 0.01% and no confirmed active exploitation (CISA KEV) has been recorded.

RemediationAI

Apply the upstream fix from commit ed378f463ef73364c89feb0fc923f4dc867332a3 (https://github.com/opencryptoki/opencryptoki/commit/ed378f463ef73364c89feb0fc923f4dc867332a3); no official tagged release incorporating this fix has been independently confirmed at time of analysis, so users should build from the patched commit or await their distribution's packaged update. As compensating controls pending patch availability: restrict access to C_CreateObject and C_UnwrapKey PKCS#11 operations to authenticated, authorized processes using slot-level access controls, limiting the API-invocation attack path (trade-off: may restrict legitimate application access); ensure token files on disk are owned by and writable only by the openCryptoki daemon account, blocking the disk-based malformed-file path (trade-off: no operational impact if administrative controls are already in place); disable or network-isolate the ICSF remote backend if not operationally required, since that path enables network-adjacent attackers to supply malformed BER data (trade-off: loss of ICSF connectivity). The security advisory is at https://github.com/opencryptoki/opencryptoki/security/advisories/GHSA-c9cf-6vr4-wfxm.

Affected VersionsENISA

opencryptoki ≤ 3.26.0

Affected Packages

euvd opencryptoki no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

openCryptoki implements the PKCS#11 cryptographic token interface standard for Linux and AIX, providing a shared library layer used by applications to interact with hardware security modules (HSMs) and software tokens. The vulnerable code is in usr/lib/common/asn1.c, which handles BER/DER (Basic Encoding Rules / Distinguished Encoding Rules) parsing for ASN.1-structured cryptographic objects such as keys and certificates. The root cause (CWE-125, Out-of-bounds Read) is that five decoder functions - ber_decode_INTEGER, ber_decode_SEQUENCE, ber_decode_OCTET_STRING, ber_decode_BIT_STRING, and ber_decode_CHOICE - accept a raw byte pointer with no corresponding buffer-length argument, so they trust the attacker-supplied BER length octets to determine how many bytes to read. The commit diff confirms the fix pattern: each function signature gained a CK_ULONG buffer-length parameter and now validates that 1 + tag + length + value does not exceed the supplied bound before dereferencing. A secondary variant exists in ber_decode_INTEGER where a zero-length encoding causes an integer underflow. Because asn1.c is the shared common library, all six token backends - Soft, ICA, CCA, TPM, EP11, and ICSF - inherit the flaw.

Know when Opencryptoki gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 6.8 MEDIUM
AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
vuln.today AI 6.8 MEDIUM

Any local process can invoke PKCS#11 API without elevated privileges; OOB read yields high availability impact and limited memory disclosure with no integrity consequence.

3.1 AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE MEDIUM
Red Hat 6.8 MEDIUM

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
High

Lifecycle Timeline

2
Patch released
Apr 19, 2026 - 08:30 nvd
Patch available
CVE Published
Apr 16, 2026 - 22:04 nvd
MEDIUM 6.8

DescriptionGitHub Advisory

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 98% exploitable
Prevalence
Low
niche HSM middleware, primarily Linux/AIX cryptographic infrastructure
Social Media
1
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed
SUSE Linux Enterprise Micro 5.4 Fixed
SUSE Linux Enterprise Micro 5.5 Fixed
SUSE Linux Enterprise Module for Server Applications 15 SP7 Fixed
SUSE Linux Enterprise Server 15 SP7 Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy