The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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
    • 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-2025-66038

CVE-2025-66038: OpenSC Buffer Overflow Vulnerability

CVE-2025-66038 is a buffer overflow flaw in OpenSC smart card middleware that enables out-of-bounds memory access through malformed compact-TLV data. This article covers technical details, affected versions, and mitigations.

Published: April 2, 2026

CVE-2025-66038 Overview

A buffer over-read vulnerability exists in OpenSC, an open source smart card tools and middleware package. The vulnerability resides in the sc_compacttlv_find_tag function, which searches a compact-TLV buffer for a given tag. When processing malformed compact-TLV data, the function fails to verify that the claimed value length fits within the remaining buffer, potentially returning out-of-bounds pointers that can lead to memory corruption when subsequently dereferenced.

Critical Impact

Attackers with physical access to a system can supply maliciously crafted smart card data or files to trigger out-of-bounds memory access, potentially leading to memory corruption and system compromise.

Affected Products

  • OpenSC versions prior to 0.27.0
  • Smart card middleware deployments using vulnerable OpenSC libraries
  • Systems reading compact-TLV formatted data from untrusted sources

Discovery Timeline

  • 2026-03-30 - CVE-2025-66038 published to NVD
  • 2026-04-01 - Last updated in NVD database

Technical Details for CVE-2025-66038

Vulnerability Analysis

This vulnerability is classified as an Out-of-Bounds Read (CWE-126). The flaw exists in OpenSC's compact-TLV parsing logic where the sc_compacttlv_find_tag function processes encoded tag-length-value structures. In the compact-TLV format, a single byte encodes both the tag (high nibble) and value length (low nibble).

When the function encounters a malformed buffer such as {0x0A}, it interprets this as tag=0 and length=10. However, no actual value bytes follow this encoded byte. The function returns a pointer equal to buf+1 and sets outlen=10 without validating that the claimed value length of 10 bytes actually exists within the remaining buffer space.

This absence of bounds checking creates a dangerous condition where subsequent code attempting to dereference the returned pointer or read the indicated number of bytes will access memory beyond the allocated buffer boundaries.

Root Cause

The root cause is insufficient input validation in the sc_compacttlv_find_tag function. The function trusts the length value encoded in the compact-TLV byte without verifying that sufficient data exists in the buffer to satisfy the claimed length. This is a classic bounds-checking oversight where the encoded metadata is not validated against the actual buffer size before returning pointers to callers.

Attack Vector

The attack requires physical access to the target system. An attacker can exploit this vulnerability by:

  1. Crafting a malicious smart card containing specially formatted compact-TLV data with inflated length values
  2. Presenting the malicious card to a system running vulnerable OpenSC middleware
  3. When the system reads and parses the card data, sc_compacttlv_find_tag returns an out-of-bounds pointer
  4. Downstream code attempting to use this pointer triggers memory corruption

The vulnerability can also be triggered through maliciously crafted files that contain compact-TLV formatted data, provided the application uses OpenSC to parse such files from untrusted sources.

Detection Methods for CVE-2025-66038

Indicators of Compromise

  • Unexpected application crashes or segmentation faults when processing smart card operations
  • Memory access violations in processes utilizing OpenSC libraries
  • Anomalous smart card read failures followed by system instability

Detection Strategies

  • Monitor for crash dumps or core files from applications using OpenSC middleware
  • Implement memory sanitizer tools (AddressSanitizer, Valgrind) during development and testing to detect out-of-bounds access
  • Review system logs for unexpected termination of smart card-related services

Monitoring Recommendations

  • Enable enhanced logging for smart card subsystem operations
  • Monitor process health for applications that interact with smart cards or parse compact-TLV data
  • Deploy endpoint detection solutions capable of identifying memory corruption exploitation attempts

How to Mitigate CVE-2025-66038

Immediate Actions Required

  • Upgrade OpenSC to version 0.27.0 or later immediately
  • Restrict physical access to systems processing smart card data from untrusted sources
  • Review applications that parse compact-TLV formatted data from external sources and validate they use patched OpenSC versions

Patch Information

OpenSC has released version 0.27.0 which addresses this vulnerability. The fix ensures proper bounds checking in the sc_compacttlv_find_tag function before returning pointers to callers. The security patch is available via the GitHub Commit Update. Additional details are available in the GitHub Security Advisory GHSA-72x5-fwjx-2459 and the GitHub CVE-2025-66038 Information page.

Workarounds

  • Implement application-level input validation before passing data to OpenSC compact-TLV parsing functions
  • Restrict smart card operations to trusted, known-good cards until patches can be applied
  • Consider disabling smart card functionality on systems where it is not strictly required until the update is deployed
bash
# Verify OpenSC version to confirm patched status
opensc-tool --version
# Expected output should show version 0.27.0 or later

# Update OpenSC on Debian/Ubuntu systems
sudo apt update && sudo apt install opensc

# Update OpenSC on RHEL/CentOS systems
sudo yum update opensc

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechOpensc

  • SeverityMEDIUM

  • CVSS Score6.8

  • EPSS Probability0.02%

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

  • GitHub Security Advisory GHSA-72x5-fwjx-2459

  • GitHub CVE-2025-66038 Information
  • Related CVEs
  • CVE-2025-49010: OpenSC Buffer Overflow Vulnerability

  • CVE-2025-66215: OpenSC Buffer Overflow Vulnerability

  • CVE-2025-66037: OpenSC Use-After-Free Vulnerability

  • CVE-2025-24531: OpenSC pam_pkcs11 Auth Bypass Flaw
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