Buffer Overrun Vulnerability in OpenSC Package: CVE-2023-2977

opensc Updated 02 Oct 2025

Summary

01/06/2023
N/A
Yes i
High
7.1

CVE-2023-2977: A vulnerbility was found in OpenSC. Affects opensc across 2 version ranges.

< 0.21.0-1+deb11u1 < 5497519ea6b4af596628f8f8f2f904bacaa3148f

Fixed in 0.21.0-1+deb11u1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

OpenSC is an open-source project that provides a set of libraries and utilities for working with smart cards. It supports various smart card standards and is widely used in applications requiring secure authentication and data storage. The package is crucial for developers and organizations that rely on smart card technology for secure transactions and identity verification. However, it has been identified to have a significant vulnerability that could compromise its functionality and security.

Vulnerability Detail

A vulnerability was found in OpenSC, specifically in the pkcs15 cardos_have_verifyrc_package function. This security flaw leads to a buffer overrun due to incorrect calculations of the remaining length of an ASN1 buffer. An attacker can exploit this by supplying a malformed smart card package, which can result in a heap-based buffer out-of-bounds read. If AddressSanitizer (ASAN) is enabled during compilation, this vulnerability can cause a crash, potentially leading to information leaks or further damage.

How To Fix

Minimum fixed version

0.21.0-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade opensc

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can disable the use of the affected function if possible, or avoid using smart card packages that are not verified or trusted until the package is updated.

Conclusion

The CVE-2023-2977 vulnerability in the OpenSC package poses a significant risk due to its potential for exploitation through buffer overrun. Users are strongly advised to update their OpenSC installations to the latest version to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for opensc →

Share this vulnerability

FAQ

CVE-2023-2977 is a buffer overrun vulnerability found in the OpenSC package that can be exploited through malformed ASN1 contexts in smart card packages.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Exploitation of this vulnerability can lead to crashes, information leaks, and potentially allow attackers to execute arbitrary code.

Yes, updating to OpenSC version 0.23.0-0.3 or later will resolve this vulnerability.

If an immediate update is not possible, consider implementing workarounds such as disabling the affected functionality or avoiding untrusted smart card packages.

Related vulnerabilities

Recent vulnerabilities recorded for opensc.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

0.21.0-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade opensc

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback