CVE-2023-40661
published 2023-11-06CVE-2023-40661: Several memory vulnerabilities were identified within the OpenSC packages, particularly in the card enrollment process using pkcs15-init when a user or…
PriorityP429medium6.4CVSS 3.1
AVPACLPRLUIRSUCHIHAH
EPSS
1.17%
64.1th percentile
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.
Affected
21 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | opensc | < opensc 0.23.0-0.3+deb12u1 (bookworm) | opensc 0.23.0-0.3+deb12u1 (bookworm) |
| msrc | azl3_opensc_0.23.0-1_on_azure_linux_3.0 | — | — |
| msrc | azl3_opensc_0.25.1-3_on_azure_linux_3.0 | — | — |
| msrc | azure_linux_3.0_arm | — | — |
| msrc | azure_linux_3.0_x64 | — | — |
| opensc_project | opensc | <= 0.23.0 | — |
| opensc_project | opensc | >= 0 < 0.21.0-1+deb11u1 | 0.21.0-1+deb11u1 |
| opensc_project | opensc | >= 0 < 0.23.0-0.3+deb12u1 | 0.23.0-0.3+deb12u1 |
| opensc_project | opensc | >= 0 < 0.23.0-2 | 0.23.0-2 |
| opensc_project | opensc | >= 0 < 0.23.0-2 | 0.23.0-2 |
| opensc_project | opensc | >= 0 < 0.15.0-1ubuntu1+esm3 | 0.15.0-1ubuntu1+esm3 |
| opensc_project | opensc | >= 0 < 0.15.0-1ubuntu1+esm2 | 0.15.0-1ubuntu1+esm2 |
| opensc_project | opensc | >= 0 < 0.17.0-3ubuntu0.1~esm3 | 0.17.0-3ubuntu0.1~esm3 |
| opensc_project | opensc | >= 0 < 0.17.0-3ubuntu0.1~esm2 | 0.17.0-3ubuntu0.1~esm2 |
| opensc_project | opensc | >= 0 < 0.20.0-3ubuntu0.1~esm3 | 0.20.0-3ubuntu0.1~esm3 |
| opensc_project | opensc | >= 0 < 0.20.0-3ubuntu0.1~esm4 | 0.20.0-3ubuntu0.1~esm4 |
| opensc_project | opensc | >= 0 < 0.20.0-3ubuntu0.1~esm2 | 0.20.0-3ubuntu0.1~esm2 |
| opensc_project | opensc | >= 0 < 0.22.0-1ubuntu2+esm1 | 0.22.0-1ubuntu2+esm1 |
| opensc_project | opensc | >= 0 < 0.25.0~rc1-1ubuntu0.1~esm1 | 0.25.0~rc1-1ubuntu0.1~esm1 |
| redhat | enterprise_linux | — | — |
| redhat | enterprise_linux | — | — |
CVSS provenance
nvdv3.16.4MEDIUMCVSS:3.1/AV:P/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
osv6.4MEDIUM
vendor_msrc6.4MEDIUM
vendor_debian5.4MEDIUM
vendor_redhat5.4MEDIUM
vendor_ubuntu5.3MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
opensc vulnerabilities
osv·2025-04-09·CVSS 5.3
[MEDIUM] opensc vulnerabilities
opensc vulnerabilities
USN-7346-1 fixed vulnerabilities in OpenSC. The update introduced a
regression which broke smartcard based authentication. This update fixes
the problem.
We apologize for the inconvenience.
Original advisory details:
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffer overflow. An attacker
could possibly use this issue to cause a denial of service or execute
arbitrary code.
OSV
opensc regression
osv·2025-03-28·CVSS 5.3
[MEDIUM] opensc regression
opensc regression
USN-7346-1 fixed vulnerabilities in OpenSC. The update introduced a
regression in Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, and Ubuntu 20.04 LTS. The
security fix has been removed pending further investigation.
We apologize for the inconvenience.
Original advisory details:
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffer overflow. An attacker
could possibly use this issue to cause
OSV
opensc vulnerabilities
osv·2025-03-12·CVSS 5.3
CVE-2021-42780 [MEDIUM] opensc vulnerabilities
opensc vulnerabilities
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffer overflow. An attacker
could possibly use this issue to cause a denial of service or execute
arbitrary code. This issue only affected Ubuntu 20.04 LTS. (CVE-2021-42782)
It was discovered that OpenSC did not correctly handle the length of
certain buffers, which could lead to a out-of-bounds access vulnerability.
An attacker co
OSV
CVE-2023-40661: Several memory vulnerabilities were identified within the OpenSC packages, particularly in the card enrollment process using pkcs15-init when a user o
osv·2023-11-06·CVSS 6.4
CVE-2023-40661 [MEDIUM] CVE-2023-40661: Several memory vulnerabilities were identified within the OpenSC packages, particularly in the card enrollment process using pkcs15-init when a user o
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.
GHSA
GHSA-2c2j-2pgv-gfgc: Several memory vulnerabilities were identified within the OpenSC packages, particularly in the card enrollment process using pkcs15-init when a user o
ghsa_unreviewed·2023-11-06
CVE-2023-40661 [MEDIUM] CWE-119 GHSA-2c2j-2pgv-gfgc: Several memory vulnerabilities were identified within the OpenSC packages, particularly in the card enrollment process using pkcs15-init when a user o
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.
Ubuntu
OpenSC vulnerabilities
vendor_ubuntu·2025-04-09·CVSS 5.3
CVE-2021-42780 [MEDIUM] OpenSC vulnerabilities
Title: OpenSC vulnerabilities
Summary: USN-7346-1 introduced a regression in OpenSC.
USN-7346-1 fixed vulnerabilities in OpenSC. The update introduced a
regression which broke smartcard based authentication. This update fixes
the problem.
We apologize for the inconvenience.
Original advisory details:
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffer overflow. An attacker
could possibly use thi
Ubuntu
OpenSC regression
vendor_ubuntu·2025-03-28·CVSS 5.3
[MEDIUM] OpenSC regression
Title: OpenSC regression
Summary: USN-7346-1 introduced a regression in OpenSC.
USN-7346-1 fixed vulnerabilities in OpenSC. The update introduced a
regression in Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, and Ubuntu 20.04 LTS. The
security fix has been removed pending further investigation.
We apologize for the inconvenience.
Original advisory details:
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffe
Ubuntu
OpenSC vulnerabilities
vendor_ubuntu·2025-03-12·CVSS 5.3
CVE-2021-42780 [MEDIUM] OpenSC vulnerabilities
Title: OpenSC vulnerabilities
Summary: Several security issues were fixed in opensc.
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a use-after-free vulnerability. An
attacker could possibly use this issue to cause a denial of service or
execute arbitrary code. This issue only affected Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-42780)
It was discovered that OpenSC did not correctly handle certain memory
operations, which could lead to a stack buffer overflow. An attacker
could possibly use this issue to cause a denial of service or execute
arbitrary code. This issue only affected Ubuntu 20.04 LTS. (CVE-2021-42782)
It was discovered that OpenSC did not correctly handle the length of
certain buffers, which cou
Microsoft
Opensc: multiple memory issues with pkcs15-init (enrollment tool)
vendor_msrc·2023-11-14·CVSS 6.4
CVE-2023-40661 [MEDIUM] CWE-119 Opensc: multiple memory issues with pkcs15-init (enrollment tool)
Opensc: multiple memory issues with pkcs15-init (enrollment tool)
FAQ: Is Azure Linux the only Microsoft product that includes this open-source library and is therefore potentially affected by this vulnerability?
One of the main benefits to our customers who choose to use the Azure Linux distro is the commitment to keep it up to date with the most recent and most secure versions of the open source libraries with which the distro is composed. Microsoft is committed to transparency in this work which is why we began publishing CSAF/VEX in October 2025. See this blog post for more information. If impact to additional products is identified, we will update the CVE to reflect this.
Mariner: Mariner
redhat: redhat
Customer Action Required: Yes
Remediation: CBL-Mariner Releases
Reference: h
Red Hat
OpenSC: multiple memory issues with pkcs15-init (enrollment tool)
vendor_redhat·2023-09-25·CVSS 5.4
CVE-2023-40661 [MEDIUM] CWE-119 OpenSC: multiple memory issues with pkcs15-init (enrollment tool)
OpenSC: multiple memory issues with pkcs15-init (enrollment tool)
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.
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 attacke
Debian
CVE-2023-40661: opensc - Several memory vulnerabilities were identified within the OpenSC packages, parti...
vendor_debian·2023·CVSS 5.4
CVE-2023-40661 [MEDIUM] CVE-2023-40661: opensc - Several memory vulnerabilities were identified within the OpenSC packages, parti...
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.
Scope: local
bookworm: resolved (fixed in 0.23.0-0.3+deb12u1)
bullseye: resolved (fixed in 0.21.0-1+deb11u1)
forky: resolved (fixed in 0.23.0-2)
sid: resolved (fixed in 0.23.0-2)
trixie: resolved (fixed in 0.23.0-2)
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://access.redhat.com/errata/RHSA-2023:7876https://access.redhat.com/errata/RHSA-2023:7879https://access.redhat.com/security/cve/CVE-2023-40661https://bugzilla.redhat.com/show_bug.cgi?id=2240913https://github.com/OpenSC/OpenSC/issues/2792#issuecomment-1674806651https://github.com/OpenSC/OpenSC/releases/tag/0.24.0-rc1https://github.com/OpenSC/OpenSC/wiki/OpenSC-security-advisorieshttp://www.openwall.com/lists/oss-security/2023/12/13/3https://access.redhat.com/errata/RHSA-2023:7876https://access.redhat.com/errata/RHSA-2023:7879https://access.redhat.com/security/cve/CVE-2023-40661https://bugzilla.redhat.com/show_bug.cgi?id=2240913https://github.com/OpenSC/OpenSC/issues/2792#issuecomment-1674806651https://github.com/OpenSC/OpenSC/releases/tag/0.24.0-rc1https://github.com/OpenSC/OpenSC/wiki/OpenSC-security-advisorieshttps://lists.debian.org/debian-lts-announce/2023/11/msg00024.htmlhttps://lists.debian.org/debian-lts-announce/2024/12/msg00026.htmlhttps://lists.fedoraproject.org/archives/list/[email protected]/message/3CPQOMCDWFRBMEFR5VK4N5MMXXU42ODE/https://lists.fedoraproject.org/archives/list/[email protected]/message/GLYEFIBBA37TK3UNMZN5NOJ7IWCIXLQP/
2023-11-06
Published