CVE-2023-40661
NixOS vulnerability analysis and mitigation

Overview

CVE-2023-40661 affects the OpenSC packages, specifically in the card enrollment process using pkcs15-init. The vulnerability was discovered in OpenSC versions before 0.24.0 and involves multiple memory vulnerabilities. The issue affects systems where users or administrators enroll cards for generating keys, loading certificates, and other card/token management operations (OpenWall, NVD).

Technical details

The vulnerability encompasses multiple memory-related issues including stack buffer overflows, heap buffer overflows, and heap double frees in various components of pkcs15-init. Specific issues include buffer overflows in sc_pkcs15_get_lastupdate, setcos_create_key, cosm_new_file, and multiple card drivers including muscle, cardos, and iasecc. The vulnerability has received a CVSS v3.1 base score of 6.4 (MEDIUM) with vector: CVSS:3.1/AV:P/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H (NVD, RedHat).

Impact

The vulnerability can potentially compromise key generation, certificate loading, and other card management operations during enrollment. However, exploitation requires physical access to the computer system and the use of a custom-crafted USB device or smart card to manipulate responses to APDUs. The issue is not exploitable through normal PKCS#11 module usage as done in most end-user deployments (OpenWall).

Mitigation and workarounds

The vulnerability has been fixed in OpenSC version 0.24.0-rc1. Various Linux distributions have released security updates to address this issue, including Red Hat Enterprise Linux 8 and 9 through RHSA-2023:7876 and RHSA-2023:7879 respectively. Users are advised to upgrade their OpenSC packages to the latest version (RedHat Advisory, OpenSC Release).

Additional resources


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-22783HIGH8.1
  • NixOSNixOS
  • iris
NoYesJan 12, 2026
CVE-2026-0821MEDIUM6.9
  • NixOSNixOS
  • quickjs
NoNoJan 10, 2026
CVE-2025-68949MEDIUM5.3
  • NixOSNixOS
  • n8n
NoYesJan 13, 2026
CVE-2026-22784LOW2.3
  • NixOSNixOS
  • lychee
NoYesJan 12, 2026
CVE-2026-23497LOW1.3
  • NixOSNixOS
  • learning
NoYesJan 14, 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