CVE-2025-66215
NixOS vulnerability analysis and mitigation

Overview

CVE-2025-66215 is a stack-based buffer overflow vulnerability in the card-oberthur driver of OpenSC, an open-source smart card tools and middleware library. An attacker with physical access to a computer can trigger a stack-buffer-overflow WRITE by presenting a crafted USB device or smart card that returns specially crafted responses to APDUs while a user or administrator is actively using a token. All OpenSC versions prior to 0.27.0 are affected, including the libopensc library and its exposed interfaces (PKCS#11 module, minidriver, CTK). The vulnerability was disclosed on March 30, 2026, and carries a CVSS v3.1 base score of 6.8 (Medium/High) per NVD, though the OpenSC project rates it 3.8 (Low) due to the high-complexity, physical-access attack requirements (GitHub Advisory, Red Hat Bugzilla).

Technical details

The vulnerability is classified as CWE-121 (Stack-based Buffer Overflow) and CWE-120 (Buffer Copy without Checking Size of Input). Specifically, the auth_compute_signature function in src/libopensc/card-oberthur.c constructs an APDU request but sets inconsistent response buffer and response buffer length values. When a malicious smart card or USB device returns more data than expected, the reader driver writes beyond the stack buffer bounds, potentially corrupting adjacent stack data. The fix involved using MIN macros and SC_MAX_APDU_RESP_SIZE constants to enforce proper bounds checking, as implemented in commits a4bbf8a and 56bc5e9, merged via PR #3436 (OpenSC Wiki, GitHub PR). The issue was originally discovered and reported by OSS-Fuzz.

Impact

Successful exploitation can result in memory corruption on the stack, potentially leading to application crashes (denial of availability), data corruption (integrity impact), or unexpected behavior that could expose sensitive data processed by OpenSC (confidentiality impact). Because the vulnerability resides in the libopensc library, it affects all consumers of the library including OpenSC command-line tools, the PKCS#11 module, the Windows minidriver, and the macOS Cryptographic Token Kit (CTK). The physical access requirement significantly limits the attack surface, but environments using smart card authentication (e.g., government, enterprise PKI) where physical security is not strictly enforced face the greatest risk (GitHub Advisory, OpenSC Wiki).

Exploitability

There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation at this time (Feedly). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.019% (0.000190), reflecting a very low probability of exploitation in the near term. Exploitation requires both physical access to the target computer and user interaction (a legitimate user must be actively using a token), making opportunistic or remote exploitation infeasible. The attack complexity is rated High by the OpenSC project due to the need for a specially crafted hardware device (GitHub Advisory).

Exploitation steps

  1. Prepare malicious device: Craft a USB smart card device or emulated smart card capable of returning arbitrary APDU responses, specifically responses larger than the buffer size expected by the auth_compute_signature function in the Oberthur card driver.
  2. Gain physical access: Obtain physical access to a target computer that has OpenSC (version < 0.27.0) installed and is configured to use smart card authentication.
  3. Wait for token usage: Wait for or socially engineer a legitimate user or administrator to initiate a smart card operation (e.g., authentication, signing) that invokes the Oberthur card driver.
  4. Insert malicious device: Connect the crafted USB device or smart card to the target system during the active token session.
  5. Trigger overflow: The malicious device responds to APDU queries with oversized data, causing the auth_compute_signature function to write beyond the stack buffer bounds, resulting in memory corruption, crash, or potentially controlled code execution depending on stack layout and platform mitigations (OpenSC Wiki, GitHub PR).

Indicators of compromise

  • Process: Unexpected crashes or segmentation faults in processes using OpenSC (e.g., pkcs11-tool, opensc-tool, PAM smart card authentication daemons, or browser processes using PKCS#11 modules) during smart card operations.
  • Logs: System logs (e.g., /var/log/syslog, /var/log/auth.log) showing segfault or abort signals from OpenSC-linked processes; application crash dumps referencing card-oberthur.c or auth_compute_signature.
  • File System: Presence of core dump files generated by OpenSC tools in working directories or /var/crash/.
  • Hardware: Unexpected or unrecognized USB smart card devices appearing in system USB device logs (dmesg, udevadm monitor) during authentication events.

Mitigation and workarounds

The primary remediation is to upgrade OpenSC to version 0.27.0 or later, which includes the fix applied in commits a4bbf8a631537a4c0083b264095ed1cd36d307ab and 56bc5e9575965461d99a274be45d71c18ab6eae0 (GitHub PR, GitHub Advisory). No official workaround is available for unpatched versions. As a compensating control, organizations should enforce strict physical access policies to workstations during smart card token usage and restrict the use of unknown or untrusted USB devices. Linux distribution users (Fedora, openSUSE, RHEL) should apply vendor-provided package updates as they become available (Red Hat Bugzilla).

Community reactions

The OpenSC project rated the vulnerability Low severity (CVSS 3.8) due to the high-complexity physical attack requirements, while NVD assigned a higher score of 6.8, reflecting a difference in scoring methodology. Red Hat tracked the issue via Bugzilla and assigned it low priority and severity. The fix was contributed by Frank Morgner and reviewed by Jakub Jelen of the OpenSC maintainer team. No significant broader media coverage or notable social media discussion has been identified beyond standard vulnerability database aggregation (GitHub Advisory, Red Hat Bugzilla).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

opensc

Affected

sid

opensc: 0.27.0~rc1-1

Fixed

trixie

opensc

Affected

Ubuntu

Unknown

bionic (esm-apps)

opensc

Unknown

devel

opensc

Unknown

focal (esm-apps)

opensc

Unknown

jammy

opensc

Unknown

jammy (esm-apps)

opensc

Unknown

noble

opensc

Unknown

noble (esm-apps)

opensc

Unknown

resolute

opensc

Unknown

RHEL / CentOS

Affected

RHEL 8

opensc.src

Affected

RHEL 9

opensc.src

Affected

RHEL 10

opensc.src

Affected

Alpine

Fixed

edge

opensc: 0.27.1-r0

Fixed

SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-78662HIGH7.5
  • Docker logoDocker
  • headlamp-fips
NoYesSep 02, 2026
CVE-2026-56855HIGH7.5
  • Docker logoDocker
  • argo-workflows-3.7
NoYesSep 02, 2026
CVE-2026-84642HIGH7.5
  • NixOS logoNixOS
  • cpe:2.3:a:mozilla:thunderbird
NoYesSep 01, 2026
CVE-2026-84641HIGH7.5
  • NixOS logoNixOS
  • cpe:2.3:a:mozilla:thunderbird
NoYesSep 01, 2026
CVE-2026-32773MEDIUM6.1
  • NixOS logoNixOS
  • spark
NoYesSep 02, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management