CVE-2023-2977 in Opensc-Project Opensc and 1 more product
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 c...
Affects 2 products from 2 vendors. Facts below cite their sources.
Requires local access, low complexity, low privileges required, no user interaction needed, impact contained to the vulnerable component, full confidentiality impact, no integrity impact, full availability impact.
Affected products and versions
| Vendor | Product | Affected versions |
|---|---|---|
| Opensc-Project | Opensc | — |
| Redhat | Enterprise Linux | 8.0 9.0 |
| Opensc Project | Opensc | 0.23.0 |
A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.
Fix and vendor advisory
Exploitation
| CISA known-exploited | Not in the CISA KEV catalog |
|---|---|
| Public exploit | Not confirmed |
Official 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.
Source: NIST NVD / MITRE CVE.
Record details
| CVE ID | CVE-2023-2977 |
|---|---|
| BreachSpider ID | BS-2023-GLOBAL-001079-H |
| CVSS vector | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H |
| Published | 2023-06-01 |
| Last modified | 2025-11-03 |
| Weakness (CWE) | |
| Source | NVD |
Weakness definitions
CWE-119: Improper Restriction of Operations within Memory Buffer
Parent class for buffer-related vulnerabilities where operations exceed buffer boundaries.
CWE-125: Out-of-Bounds Read
Software reads data past the boundary of an allocated buffer, leaking sensitive information or causing crashes.
Related attack patterns (CAPEC)
CAPEC-8 Buffer Overflow in an API Call via CWE-119
CAPEC-9 Buffer Overflow in Local Command-Line Utilities via CWE-119
CAPEC-10 Buffer Overflow via Environment Variables via CWE-119
CAPEC-14 Client-side Injection-induced Buffer Overflow via CWE-119
CAPEC-24 Filter Failure through Buffer Overflow via CWE-119
Show all 13
CAPEC-42 MIME Conversion via CWE-119
CAPEC-44 Overflow Binary Resource File via CWE-119
CAPEC-45 Buffer Overflow via Symbolic Links via CWE-119
CAPEC-46 Overflow Variables and Tags via CWE-119
CAPEC-47 Buffer Overflow via Parameter Expansion via CWE-119
CAPEC-100 Overflow Buffers via CWE-119
CAPEC-540 Overread Buffers via CWE-125
CAPEC-123 Buffer Manipulation via CWE-119
Mapping is CWE to CAPEC per MITRE CAPEC 3.9.
Analysis AI-written, not human-reviewed
A buffer overrun vulnerability exists in the pkcs15 cardos_have_verify function of OpenSC, which can be exploited by supplying a smart card package with malformed ASN1 context, leading to a heap-based buffer overflow.
The vulnerability arises from an incorrect calculation of the remaining length in the ASN1 buffer due to a moved starting pointer, allowing an attacker to potentially execute arbitrary code or cause a denial of service.
Questions
What is CVE-2023-2977?
A buffer overrun vulnerability exists in the pkcs15 cardos_have_verify function of OpenSC, which can be exploited by supplying a smart card package with malformed ASN1 context, leading to a heap-based buffer overflow.
What is the CVSS score for CVE-2023-2977?
CVE-2023-2977 has CVSS 7.1 (High). Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H. EPSS: 0.4%.
Is CVE-2023-2977 actively exploited?
No confirmed active exploitation of CVE-2023-2977 as of 2026-05-30.
How do I remediate CVE-2023-2977?
Priority: HIGH. Advisory: https://access.redhat.com/security/cve/CVE-2023-2977
What systems are affected by CVE-2023-2977?
CVE-2023-2977 affects Opensc-Project Opensc; Redhat Enterprise Linux.
For developers and AI agents
Run this check from your own code or agent
REST API
curl -s https://breachspider.com/api/v1/assets/correlate-cves \
-H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assets":[{"asset_id":"dev-1","vendor":"Opensc-Project","product":"Opensc","version":"1.0"}]}'
MCP for AI agents
# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp
Free trial: 14 days, 750 device checks, no card.
Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2025-11-03.