Where
-Infinity
0

Vendor Risk Score

See how opensc compares to other vendors in security performance

View Risk Score →
Severity
6.8
CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L

OpenSC is an open source smart card tools and middleware. Prior to version 0.27.0, sccompacttlvfindtag searches a compact-TLV buffer for a given tag. In compact-TLV, a single byte encodes the tag (high nibble) and value length (low nibble). With a 1-byte buffer {0x0A}, the encoded element claims tag=0 and length=10 but no value bytes follow. Calling sccompacttlvfindtag with search tag 0x00 returns a pointer equal to buf+1 and outlen=10 without verifying that the claimed value length fits within the remaining buffer. In cases where the sccompacttlvfindtag is provided untrusted data (such as being read from cards/files), attackers may be able to influence it to return out-of-bounds pointers leading to downstream memory corruption when subsequent code tries to dereference the pointer. This issue has been patched in version 0.27.0.

1 / 2
Source: NVD
First published (updated )
Severity
6.8
AV:P/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L

OpenSC is an open source smart card tools and middleware. Prior to version 0.27.0, feeding a crafted input to the fuzzpkcs15reader harness causes OpenSC to perform an out-of-bounds heap read in the X.509/SPKI handling path. Specifically, scpkcs15pubkeyfromspkifields() allocates a zero-length buffer and then reads one byte past the end of that allocation. This issue has been patched in version 0.27.0.

1 / 2
Source: MITRE
First published (updated )
Severity
6.8
CVSS:3.1/AV:P/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L

OpenSC is an open source smart card tools and middleware. Prior to version 0.27.0, an attacker with physical access to the computer at the time user or administrator uses a token can cause a stack-buffer-overflow WRITE in card-oberthur. The attack requires crafted USB device or smart card that would present the system with specially crafted responses to the APDUs. This issue has been patched in version 0.27.0.

1 / 2
Source: NVD
First published (updated )
Severity
6.8
AV:P/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L

OpenSC is an open source smart card tools and middleware. Prior to version 0.27.0, an attacker with physical access to the computer at the time user or administrator uses a token can cause a stack-buffer-overflow write in GET RESPONSE. The attack requires crafted USB device or smart card that would present the system with specially crafted responses to the APDUs. This issue has been patched in version 0.27.0.

1 / 2
Source: MITRE
First published (updated )
Severity
5.7
AV:P/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H

Multiple issues with uninitialized variables were found in libopensc that may lead to information disclosure or application crash. An attack requires a crafted USB device or smart card that would present the system with specially crafted responses to the APDUs

1 / 2
Source: Red Hat
First published (updated )
Severity
4
Buffer Overflow

Three stack-based buffer overflow flaws were found in the way OpenSC device drivers for A-Trust ACOS, ACS ACOS5 and STARCOS SPK 2.3 based smart cards processed certain values of card serial number. A local attacker could use this flaw to execute arbitrary code, with the privileges of the user running the opesc-tool or opensc-explorer binaries via a malicious smart card, with specially-crafted value of its serial number, inserted to the system.

References: [1] http://labs.mwrinfosecurity.com/files/Advisories/mwriopensc-get-serial-buffer-overflow2010-12-13.pdf [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607732 [3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607427 [4] http://www.h-online.com/open/news/item/When-a-smart-card-can-root-your-computer-1154829.html [5] https://bugs.launchpad.net/ubuntu/+source/opensc/+bug/692483

Upstream changesets: [6] https://www.opensc-project.org/opensc/changeset/4913 [7] https://www.opensc-project.org/opensc/changeset/4912

First published (updated )
Severity
1.3
Buffer Overflow
AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L/E:P/RL:O/RC:C

A flaw has been found in OpenSC up to 0.26.1. This affects the function testkpgencertwrite of the file src/tools/pkcs11-tool.c of the component pkcs11-tool Key Generation Module. This manipulation causes buffer overflow. The attack is possible to be carried out remotely. The complexity of an attack is rather high. It is indicated that the exploitability is difficult. The exploit has been published and may be used. Patch name: 814f745b3b6d100295f65f1935edd33d520d33ab. It is recommended to apply a patch to fix this issue.

1 / 2
Source: MITRE
First published (updated )
Severity
1
Use After Free

The Use After Free vulnerability was identified within the AuthentIC driver in OpenSC packages, particularly in the card enrollment process using pkcs15-init when a user or administrator enrolls or modifies cards. An attacker must have physical access to the computer system to take advantage of this flaw. The attack requires a crafted USB device or smart card to present the system with specially crafted responses to the APDUs, which are considered high complexity and low severity. This manipulation can potentially allow for compromising card management operations during enrollment.

Originally reported by OSS-fuzz automated service.

First published (updated )
Severity
1

The reported issues are part of the libopensc library, which makes them accessible from OpenSC tools, PKCS#11 module, minidriver, or CTK. The attack requires a crafted USB device or smart card that would present the system with specially crafted responses to the APDUs, so they are considered high complexity and low severity.

Insufficient or missing checking of return values of functions leads to unexpected work with variables that have not been initialized. The uninitialized variables were reflected in the following functions:

- bcdmp, called from caclistcomparepath - cardoslifecycleget - scpkcs15readfile

Originally reported by Matteo Marini (Sapienza University of Rome)

First published (updated )
Severity
1

The reported issues are part of the libopensc library, which makes them accessible from OpenSC tools, PKCS#11 module, minidriver, or CTK. The attack requires a crafted USB device or smart card that would present the system with specially crafted responses to the APDUs, so they are considered high complexity and low severity.

When buffers are partially filled with data, uninitialized parts of the buffer can be incorrectly accessed. The uninitialized variables were reflected in the following functions:

- insertcert - asn1encodepath - gemsafegetcertlen - setcosgeneratekey - schsmdeterminefreeid - coolkeyrsaop

Originally reported by Matteo Marini (Sapienza University of Rome)

First published (updated )
Severity
1

The reported issues are part of the libopensc library, which makes them accessible from OpenSC tools, PKCS#11 module, minidriver, or CTK. The attack requires a crafted USB device or smart card that would present the system with specially crafted responses to the APDUs, so they are considered high complexity and low severity.

The following problems were caused by insufficient control of the response APDU buffer and its length when communicating with the card. The uninitialized variables were reflected in these functions:

- cardosmatchcard - itoaword, called from schexdump - scbintohex - strcmp, called from scasn1readtag - asn1decode - processfcp - dnieprocessfci - iso7816processfci - scpkcs15initparseinfo, mscextractrsapublickey - scbintohex - gidsreadmasterfile - scbintohex

Originally reported by Matteo Marini (Sapienza University of Rome)

First published (updated )
Severity
1

The reported issues are part of the libopensc library, which makes them accessible from OpenSC tools, PKCS#11 module, minidriver, or CTK. One is only relevant to handling the card enrollment using the pkcs15-init tool. The attack requires a crafted USB device or smart card that would present the system with specially crafted responses to the APDUs, so they are considered high complexity and low severity.

The problem is missing initialization of variables expected to be initialized (as arguments to other functions, etc.). The uninitialized variables were reflected in the following functions:

- cacreadfile - pivgetchallenge - scasn1decodeobjectid - scpkcs15emuschsmdecodecvc - doinitapp, scpkcs15initcreatepin

Originally reported by Matteo Marini (Sapienza University of Rome)

First published (updated )
Severity
1

The reported issues are part of the card enrollment process using the pkcs15-init tool. The attack requires a crafted USB device or smart card that would present the system with specially crafted responses to the APDUs, so they are considered high complexity and low severity.

When buffers are partially filled with data, uninitialized parts of the buffer can be incorrectly accessed. The uninitialized variables were reflected in the following functions:

- starcoswritepukey - iaseccsdoparse - setcosgeneratekey - schsmdeterminefreeid

Originally reported by Matteo Marini (Sapienza University of Rome)

First published (updated )
Severity
1
Buffer Overflow

Buffer overrun vulnerability in pkcs15 cardoshaveverifyrcpackage https://github.com/OpenSC/OpenSC/issues/2785

First published (updated )
Severity
1

Multiple issues with uninitialized variables were found in libopensc that may lead to information disclosure or application crash. An attack requires a crafted USB device or smart card that would present the system with specially crafted responses to the APDUs

First published (updated )
Severity
1
Buffer Overflow
AV:P/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L

OpenSC before 0.27.0-rc1, fixed in commit 3f24f0b, contains a stack buffer overflow vulnerability in pivprocesshistory() in src/libopensc/card-piv.c that allows physically present attackers to trigger memory corruption by presenting a crafted PIV smart card or USB device returning a URL field longer than 118 bytes in the Key History Object ASN.1 response.

First published (updated )
Severity
1
Buffer Overflow
AV:P/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L

OpenSC before 0.27.0, fixed in commit 0358817, contains a stack and heap buffer overrun vulnerability in the dokeyvalue() function in src/pkcs15init/profile.c that allows attackers to corrupt memory by supplying a crafted profile configuration file. During pkcs15-init invocation, a key value entry beginning with '=' followed by more than sizeof(keybuf) characters is copied into keybuf via memcpy without a length check, causing both stack and heap buffer overruns.

First published (updated )

Many will have seen the recent post from Anthropic (1) and associated reporting that says they found 500+ vulnerabilities and lists 3 of them. These three issues don’t appear to have CVEs and two don’t appear in releases. I don’t know if that indicates the maintainers don't agree with the significance of these findings, but I wonder if the other 498+ vulnerabilities also lack CVEs.

1. For OpenSC, the commit appears to be:

https://github.com/OpenSC/OpenSC/commit/9ab1daf21029dd18f8828d684ee6151d9238edab

There are no disclosed security issues more recent than 2024 at https://github.com/OpenSC/OpenSC/security and the last release was OpenSC 0.26.1.

2. For cgif, the fix is https://github.com/dloebl/cgif/commit/07052febd3a252d30e6f0de67b2ea4f6b9aacddd and it appears in v0.5.1.

4. For ghostscript, the commit appears to be https://github.com/ArtifexSoftware/ghostpdl/commit/4e392a82d1b1780cab85804728317f36a9c4f7f7 which references a nonpublic bug 709080 <https://bugs.ghostscript.com/showbug.cgi?id=709080>. The last release is 10.06.0 (2025-09-09) so there is no release with this fix.

Anthropic’s post: https://red.anthropic.com/2026/zero-days/

Joe

On 2/20/26 8:17 AM, Joe Malcolm wrote: Many will have seen the recent post from Anthropic (1) and associated reporting that says they found 500+ vulnerabilities and lists 3 of them. These three issues don’t appear to have CVEs and two don’t appear in releases. I don’t know if that indicates the maintainers don't agree with the significance of these findings, but I wonder if the other 498+ vulnerabilities also lack CVEs.

1. For OpenSC, the commit appears to be:

https://github.com/OpenSC/OpenSC/ commit/9ab1daf21029dd18f8828d684ee6151d9238edab

There are no disclosed security issues more recent than 2024 at https://github.com/OpenSC/OpenSC/security and the last release was OpenSC 0.26.1. https://github.com/OpenSC/OpenSC/pull/3554 The strcat is a magnet to any static analysis tools and CVEs. Lets get rid of that and replace it with the "safe" strlcat I think this indicates they made the change solely because they were fed up with "security report harassment" and hoped that by making a change they saw as pointless, they could "defang" LLM tooling that reports "use of xxx function could be buggy, you use the function, we shall report it by assuming it is indeed buggy".

-- Eli Schwartz

This advisory summarizes automatically reported issues that are security relevant that were reported since the release of OpenSC 0.23.0 and that are relevant to the handling the card enrollment process using pkcs15-init.

All of these require physical access to the computer at the time user or administrator would be enrolling the cards (generating keys and loading certificates, other card/token management) operations. The attack requires crafted USB device or smart card that would present the system with specially crafted responses to the APDUs so they are considered a high-complexity and low-severity. This issue is not exploitable just by using a PKCS#11 module as done in most of the end-user deployments.

Security-related oss-fuzz issues

Stack buffer overflow in scpkcs15getlastupdate in pkcs15init https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60769 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60527 fixed with 245efe608d083fd4e4ec96793fdefd218e26fde7

Heap buffer overflow in setcoscreatekey in pkcs15init https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60672 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64181 fixed with 440ca666eff10cc7011901252d20f3fc4ea23651 4013a807492568bf9907cfb3df41f130ac83c7b9

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60650 Heap buffer overflow in cosmnewfile in pkcs15init fixed with 41d61da8481582e12710b5858f8b635e0a71ab5e

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60616 Heap double free in scpkcs15freeobjectcontent fixed with 638a5007a5d240d6fa901aa822cfeef94fe36e85

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58932 Stack buffer overflow in cflexdeletefile in pkcs15init fixed with c449a181a6988cc1e8dc8764d23574e48cdc3fa6

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56213 Heap buffer overflow in schsmwriteef in pkcs15init not in any released version, fixed with dd138d0600a1acd7991989127f36827e5836b24e

Stack buffer overflow while parsing pkcs15 profile files https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55998 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55851 fixed with 5631e9843c832a99769def85b7b9b68b4e3e3959

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54312 Stack buffer overflow in muscle driver in pkcs15init fixed with df5a176bfdf8c52ba89c7fef1f82f6f3b9312bc1

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53927 Stack buffer overflow in cardos driver in pkcs15init fixed with 578aed8391ef117ca64a9e0cba8e5c264368a0ec

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64215 Heap buffer overflow in epass2003 driver in pkcs15init fixed with 609164045facaeae193feb48d9c2fc5cc4321e8a

Heap buffer overflow in iasecc driver in pkcs15init https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63949 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63587 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63163 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=61797 fixed with 8fc2c20c3f895569eeb58328bb882aec07325d3b fbda61d0d276dc98b9d1d1e6810bbd21d19e3859 83b9129bd3cfc6ac57d5554e015c3df85f5076dc 2a4921ab23fd0853f327517636c50de947548161

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63104 Stack buffer overflow in entersafe driver in pkcs15init fixed with 50f0985f6343eeac4044661d56807ee9286db42c

Heap buffer overflow in oberthur driver in pkcs15init https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60650 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62613 fixed with 41d61da8481582e12710b5858f8b635e0a71ab5e

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=61750 Stack buffer overflow in idprime driver in pkcs15init fixed with fa8ad362852dbefad5b6796c32f2a33859b8a8e0

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60971 Heap buffer overflow in testverify fixed with ffbff25ec6c6d0ad3f8df76f57210698f7947fc3

Originally reported by OSS-fuzz automated service

The full release notes for the 0.24.0 is available in announce list:

https://sourceforge.net/p/opensc/mailman/message/58712583/

and on github:

https://github.com/OpenSC/OpenSC/releases/tag/0.24.0

When the token/card was plugged into the computer and authenticated from one process, it could be used to provide cryptographic operations from different process when the empty, zero-length PIN was provided and the token could track the login status using some of its internals. This is dangerous for OS logon/screen unlock and small tokens that are plugged permanently to the computer. The bypass was removed and OpenSC implemented explicit logout for most of the card drivers to prevent leaving unattended logged-in tokens.

The PoC is available for MacOS screen unlock bypass with Yubikey. The issue can be reproduced also with a PKCS#11 module and Minidriver if the calling applications does not bail out on empty pin (For example with Firefox. The SSSD does not allow empty PIN under Linux even before reaching out to the PKCS#11 module).

Note, that the login tracking is still useful on the pkcs15init layer so the second commit restores the similar code block in more appropriate place which could not be misused to bypass authentication on PKCS#11 layer.

Affected versions: OpenSC 0.17.0 - 0.23.0

Fixed with:

868f76fb31255fd3fdacfc3e476452efeb61c3e7 80cc5d30635f0d2c92b5099c0f9dc680d0ffce2f

Originally reported by Deepanjan Pal (Oracle Corporation)

CVSS:3.0/AV:P/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H (7.3)

The full release notes for the 0.24.0 is available in announce list:

https://sourceforge.net/p/opensc/mailman/message/58712583/

and on github:

https://github.com/OpenSC/OpenSC/releases/tag/0.24.0

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203