Heap-buffer-overflow in myeid_create_key in opensc

opensc Updated 02 Oct 2025

Summary

02/06/2022
HIGH
Yes i
High
Not published

OSV-2022-451: Heap-buffer-overflow in myeid_create_key. Affects opensc versions >= bec4f63c5b8308d7fdca842c5c0b62c3491d106a, < 367c3ad2ef2c10cb29602f72163e7fb23c3f5827. Fixed in 367c3ad2ef2c10cb29602f72163e7fb23c3f5827. 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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

OpenSC is an open-source smart card library that provides a set of cryptographic functions and protocols for interacting with smart cards. It is commonly used in applications that require secure authentication and data encryption. The myeid_create_key function in OpenSC is responsible for creating a new key on a smart card. However, a vulnerability has been discovered in this function that can lead to a heap-buffer-overflow write error.

Vulnerability Detail

The vulnerability in myeid_create_key can be triggered when a malicious attacker provides specially crafted input to the function. This can result in a heap-buffer-overflow write error, potentially leading to arbitrary code execution or a denial of service. The vulnerability was reported through the OSS-Fuzz project and has been assigned a high severity rating. The affected version of OpenSC is bec4f63c5b8308d7fdca842c5c0b62c3491d106a, and it has been fixed in version 367c3ad2ef2c10cb29602f72163e7fb23c3f5827.

How To Fix

Minimum fixed version

367c3ad2ef2c10cb29602f72163e7fb23c3f5827

This is the first release that contains the fix.

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

Workaround

There is no known workaround for this vulnerability. It is strongly advised to update to the fixed version of OpenSC as soon as possible.

Conclusion

In conclusion, a heap-buffer-overflow write vulnerability has been discovered in the myeid_create_key function of OpenSC. This vulnerability can potentially lead to arbitrary code execution or a denial of service. It is crucial to update to the fixed version of OpenSC to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for opensc →

Share this vulnerability

FAQ

OpenSC is an open-source smart card library that provides cryptographic functions and protocols for interacting with smart cards.

This vulnerability can potentially allow an attacker to execute arbitrary code or cause a denial of service.

This vulnerability was discovered through the OSS-Fuzz project, which performs continuous fuzz testing on open-source software.

This vulnerability has been assigned a high severity rating.

To fix this vulnerability, update to the latest version of OpenSC (version 367c3ad2ef2c10cb29602f72163e7fb23c3f5827).

Related vulnerabilities

Recent vulnerabilities recorded for opensc.

How To Fix

Minimum fixed version

367c3ad2ef2c10cb29602f72163e7fb23c3f5827

This is the first release that contains the fix.

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