Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40253

CVE-2026-40253: openCryptoki Buffer Overflow Vulnerability

CVE-2026-40253 is a buffer overflow flaw in openCryptoki that allows attackers to trigger out-of-bounds reads through malformed BER-encoded objects. This article covers technical details, affected versions, and mitigation.

Published: April 16, 2026

CVE-2026-40253 Overview

CVE-2026-40253 is an out-of-bounds read vulnerability affecting openCryptoki, a PKCS#11 library that provides cryptographic tooling for Linux and AIX systems. The vulnerability exists in the BER/DER decoding functions within the shared common library (asn1.c), where these functions accept a raw pointer without a corresponding buffer length parameter. The decoders trust attacker-controlled BER length fields without validating them against actual buffer boundaries, enabling potential out-of-bounds memory access.

Critical Impact

Attackers can supply malformed BER-encoded cryptographic objects through PKCS#11 operations to trigger out-of-bounds reads, potentially causing denial of service or leaking sensitive cryptographic material from memory across all token backends.

Affected Products

  • openCryptoki versions 3.26.0 and below
  • All token backends: Soft, ICA, CCA, TPM, EP11, and ICSF
  • Linux and AIX systems using the affected PKCS#11 library

Discovery Timeline

  • 2026-04-16 - CVE-2026-40253 published to NVD
  • 2026-04-16 - Last updated in NVD database

Technical Details for CVE-2026-40253

Vulnerability Analysis

This vulnerability stems from a fundamental design flaw in the BER/DER decoding implementation within openCryptoki's shared common library. The affected primitive decoders—ber_decode_INTEGER, ber_decode_SEQUENCE, ber_decode_OCTET_STRING, ber_decode_BIT_STRING, and ber_decode_CHOICE—lack proper bounds checking when parsing encoded cryptographic objects.

When processing BER-encoded data, the decoders read length fields from the input stream and use them to determine how much data to parse. However, these length values are taken directly from attacker-controlled input without verification against the actual available buffer size. This creates a classic out-of-bounds read condition (CWE-125) where the decoder can read past the end of allocated memory.

Additionally, ber_decode_INTEGER can produce integer underflows when the encoded length field is zero, further compounding the vulnerability. Since the vulnerable code resides in the shared common library, all token backends that use these parsing functions are affected, including software tokens, hardware security module integrations, and remote backend communications.

Root Cause

The root cause is the absence of buffer length parameters in the BER decoding function signatures. The original implementation accepted only raw pointers to the BER-encoded data without accompanying length information to establish buffer boundaries. This design oversight meant the decoders had no way to validate that requested read operations would remain within allocated memory regions. The fix introduces proper length parameters to all affected decoder functions, enabling boundary validation before memory access.

Attack Vector

An attacker can exploit this vulnerability through multiple entry points that accept BER-encoded cryptographic objects:

  1. PKCS#11 Operations: Functions such as C_CreateObject or C_UnwrapKey that parse cryptographic key material
  2. Token Loading: When tokens are loaded from disk, malformed BER data in stored objects can trigger the vulnerability
  3. Remote Backend Communication: Token backends communicating with remote cryptographic services may process malicious BER payloads

The attack requires local access and the ability to provide crafted input to the affected PKCS#11 operations. A successful exploit can cause the application to read memory beyond buffer boundaries, potentially crashing the service (denial of service) or leaking sensitive information stored in adjacent memory locations.

c
// Security patch adding buffer length parameter to ber_decode_INTEGER
// Source: https://github.com/opencryptoki/opencryptoki/commit/ed378f463ef73364c89feb0fc923f4dc867332a3

                             CK_ULONG *ber_int_len,
                             CK_BYTE *data, CK_ULONG data_len);
 
-CK_RV ber_decode_INTEGER(CK_BYTE *ber_int,
+CK_RV ber_decode_INTEGER(CK_BYTE *ber_int, CK_ULONG ber_int_len,
                          CK_BYTE **data,
                          CK_ULONG *data_len, CK_ULONG *field_len);
c
// Updated key_mgr.c to pass buffer length to ber_decode_PrivateKeyInfo
// Source: https://github.com/opencryptoki/opencryptoki/commit/ed378f463ef73364c89feb0fc923f4dc867332a3

 {
     CK_BYTE *alg = NULL;
     CK_BYTE *priv_key = NULL;
-    CK_ULONG alg_len, i;
+    CK_ULONG alg_len, priv_key_len, i;
     CK_RV rc;
 
-    rc = ber_decode_PrivateKeyInfo(keydata, keylen, &alg, &alg_len, &priv_key);
+    rc = ber_decode_PrivateKeyInfo(keydata, keylen, &alg, &alg_len,
+                                   &priv_key, &priv_key_len);
     if (rc != CKR_OK) {
         TRACE_DEVEL("ber_decode_PrivateKeyInfo failed.\n");
         return rc;

Detection Methods for CVE-2026-40253

Indicators of Compromise

  • Unexpected crashes or segmentation faults in processes using openCryptoki libraries
  • Abnormal memory access patterns in PKCS#11 application logs
  • Unexpected failures during cryptographic operations involving key creation or unwrapping
  • Core dumps showing out-of-bounds memory access in asn1.c related functions

Detection Strategies

  • Monitor system logs for crashes in applications linked against libopencryptoki with stack traces pointing to BER decoding functions
  • Implement memory sanitizer tools (AddressSanitizer) in development and testing environments to detect out-of-bounds reads
  • Review PKCS#11 audit logs for repeated failures in C_CreateObject, C_UnwrapKey, or token loading operations
  • Deploy runtime application self-protection (RASP) solutions to detect anomalous memory access patterns

Monitoring Recommendations

  • Enable verbose logging for openCryptoki operations to capture detailed error information
  • Configure crash reporting and core dump collection for processes using PKCS#11 libraries
  • Monitor for unusual patterns in cryptographic key management operations
  • Set up alerts for repeated PKCS#11 operation failures that may indicate exploitation attempts

How to Mitigate CVE-2026-40253

Immediate Actions Required

  • Update openCryptoki to a version containing commit ed378f463ef73364c89feb0fc923f4dc867332a3 or later
  • Review and restrict access to PKCS#11 interfaces to trusted users and applications only
  • Audit stored token data for potentially malformed BER-encoded objects
  • Implement network segmentation to limit exposure of systems using remote token backends

Patch Information

The openCryptoki maintainers have released a security patch through commit ed378f463ef73364c89feb0fc923f4dc867332a3. This patch modifies all affected BER decoding functions to accept buffer length parameters, enabling proper boundary validation before memory access operations. The fix affects multiple files including h_extern.h, key_mgr.c, and asn1.c in the common library.

For detailed patch information, refer to the GitHub Security Advisory and the commit details.

Workarounds

  • Restrict PKCS#11 slot access through system permissions to limit which users can perform cryptographic operations
  • Implement input validation at application layer before passing data to PKCS#11 functions
  • Isolate openCryptoki services in containers or sandboxed environments to limit impact of potential exploitation
  • Disable unused token backends to reduce the attack surface
bash
# Example: Restrict access to openCryptoki configuration and slot directories
chmod 700 /etc/opencryptoki
chmod 700 /var/lib/opencryptoki
chown -R root:pkcs11 /etc/opencryptoki /var/lib/opencryptoki

# Verify installed version and check for vulnerability
opencryptoki -v
# Upgrade to patched version through package manager
# For RHEL/CentOS:
yum update opencryptoki
# For Debian/Ubuntu:
apt-get update && apt-get upgrade opencryptoki

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechOpencryptoki

  • SeverityMEDIUM

  • CVSS Score6.8

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-125
  • Technical References
  • GitHub Commit Update

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-22791: openCryptoki Buffer Overflow Vulnerability

  • CVE-2026-23893: openCryptoki Privilege Escalation Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English