Stack-use-after-return in test_update in opensc

opensc Updated 02 Oct 2025

Summary

29/05/2022
N/A
Yes i
Unrated
Not published

OSV-2022-439: Stack-use-after-return in test_update. Affects opensc versions >= 217590ce6d0d02bb9abe20ac26bde8774cf8c8a4, < d1a3039c350bf081cae132d6ffc1781d01fd55c6. Fixed in d1a3039c350bf081cae132d6ffc1781d01fd55c6. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

OpenSC is an open-source smart card library and middleware that provides a set of cryptographic functions and APIs for interacting with smart cards. It is commonly used in various applications that require smart card authentication and secure data storage. The vulnerability in the test_update function of OpenSC can lead to a stack-use-after-return issue, which can potentially be exploited by an attacker to execute arbitrary code or cause a denial of service.

Vulnerability Detail

The stack-use-after-return vulnerability in the test_update function of OpenSC arises when the function reads from a stack-allocated variable after it has been deallocated. This can result in the use of invalid or unexpected data, leading to unpredictable behavior and potential security risks. In the context of the test_update function, this vulnerability can be triggered by specific inputs, potentially allowing an attacker to manipulate the program's control flow or access sensitive information from the stack. The vulnerability was discovered through OSS-Fuzz testing.

How To Fix

Minimum fixed version

d1a3039c350bf081cae132d6ffc1781d01fd55c6

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

As a temporary workaround, developers can disable or avoid using the test_update function in their applications until the fix is applied. This can help mitigate the risk of exploitation, but it is strongly recommended to apply the official fix as soon as possible.

Conclusion

The stack-use-after-return vulnerability in the test_update function of OpenSC can pose significant security risks, potentially allowing attackers to execute arbitrary code or cause a denial of service. It is crucial for developers to apply the provided fix to prevent exploitation. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for opensc →

Share this vulnerability

FAQ

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

A stack-use-after-return vulnerability occurs when a program reads from a stack-allocated variable after it has been deallocated, leading to unpredictable behavior and potential security risks.

This vulnerability can potentially be exploited by an attacker to execute arbitrary code or cause a denial of service by manipulating the program's control flow or accessing sensitive information from the stack.

This vulnerability was discovered through OSS-Fuzz testing, which is a continuous fuzzing service for open-source software.

To protect your application, it is recommended to apply the provided fix by updating to the fixed version of OpenSC as soon as possible.

Related vulnerabilities

Recent vulnerabilities recorded for opensc.

How To Fix

Minimum fixed version

d1a3039c350bf081cae132d6ffc1781d01fd55c6

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