Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2023-2977: CWE-119 in OpenSC

0
High
VulnerabilityCVE-2023-2977cvecve-2023-2977cwe-119
Published: Thu Jun 01 2023 (06/01/2023, 00:00:00 UTC)
Source: CVE Database V5
Product: OpenSC

Description

A vulnerbility was found in OpenSC. This security flaw cause a buffer overrun vulnerability in pkcs15 cardos_have_verifyrc_package. The attacker can supply a smart card package with malformed ASN1 context. The cardos_have_verifyrc_package function scans the ASN1 buffer for 2 tags, where remaining length is wrongly caculated due to moved starting pointer. This leads to possible heap-based buffer oob read. In cases where ASAN is enabled while compiling this causes a crash. Further info leak or more damage is possible.

AI-Powered Analysis

AILast updated: 11/04/2025, 00:14:42 UTC

Technical Analysis

CVE-2023-2977 is a buffer overrun vulnerability categorized under CWE-119 found in OpenSC version 0.23.0, a widely used open-source toolset for smart card integration. The vulnerability exists in the pkcs15 cardos_have_verifyrc_package function, which processes ASN.1 encoded smart card packages. The flaw stems from incorrect calculation of the remaining length in the ASN.1 buffer due to a pointer adjustment error. Specifically, the function scans the ASN.1 buffer for two tags, but the starting pointer is moved without properly recalculating the remaining buffer length, leading to a heap-based out-of-bounds (OOB) read. When compiled with AddressSanitizer (ASAN), this results in a crash, indicating memory safety violations. Although no known exploits are currently reported, an attacker with low privileges and local access can supply a malformed smart card package to trigger this vulnerability. The impact includes potential information disclosure through memory leakage and denial of service via application crashes. The vulnerability does not require user interaction but does require local privileges, limiting remote exploitation. The CVSS v3.1 score is 7.1 (High), reflecting a high confidentiality impact and high availability impact, with low attack complexity and privileges required. This vulnerability is critical for environments relying on OpenSC for secure smart card operations, such as authentication, digital signatures, and secure key storage.

Potential Impact

For European organizations, the vulnerability poses significant risks in sectors that depend on smart card technology for authentication, identity management, and secure transactions, including government agencies, financial institutions, and healthcare providers. The heap-based buffer overread can lead to information leakage, potentially exposing sensitive cryptographic material or personal data stored on smart cards. Additionally, the vulnerability can cause application crashes, resulting in denial of service conditions that disrupt critical security workflows. Since OpenSC is often integrated into middleware for smart card readers, exploitation could undermine trust in secure authentication mechanisms and digital signatures. The requirement for local access and low privileges means insider threats or compromised endpoints could leverage this flaw. The absence of known exploits currently reduces immediate risk but does not eliminate the threat, especially as attackers may develop exploits over time. Organizations failing to address this vulnerability may face regulatory compliance issues under GDPR due to potential data breaches. Overall, the impact is high for entities relying on OpenSC in their security infrastructure.

Mitigation Recommendations

1. Monitor OpenSC project updates and apply patches promptly once a fixed version addressing CVE-2023-2977 is released. 2. Until patches are available, restrict access to systems and applications that process smart card packages to trusted users only, minimizing the risk of local exploitation. 3. Implement strict input validation and ASN.1 parsing sanity checks at the application or middleware level to detect and reject malformed smart card packages before processing. 4. Employ runtime protections such as AddressSanitizer or similar memory safety tools during development and testing to detect and prevent exploitation attempts. 5. Harden endpoint security to prevent unauthorized local access, including enforcing least privilege principles and using endpoint detection and response (EDR) solutions. 6. Conduct regular security audits and penetration testing focused on smart card integration components to identify and remediate related vulnerabilities. 7. Educate users and administrators about the risks of handling untrusted smart card packages and enforce policies to avoid usage of unknown or suspicious cards. 8. Consider isolating smart card processing services in sandboxed or containerized environments to limit the impact of potential exploitation.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.2
Assigner Short Name
redhat
Date Reserved
2023-05-30T00:00:00.000Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6909262ffe7723195e0b5edd

Added to database: 11/3/2025, 10:01:19 PM

Last enriched: 11/4/2025, 12:14:42 AM

Last updated: 11/6/2025, 1:23:18 PM

Views: 1

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats