Stack-buffer-overflow in pgp_parse_algo_attr_blob in opensc

opensc Updated 02 Oct 2025

Summary

22/07/2020
HIGH
Yes i
High
Not published

OSV-2020-969: Stack-buffer-overflow in pgp_parse_algo_attr_blob. Affects opensc versions >= c4dcac5de77825e79763c9cd5f58aa8bde22f0b2, < 333c41c5d51450177553b8fd8cb2d710a7f7dec5. Fixed in 333c41c5d51450177553b8fd8cb2d710a7f7dec5. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

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 vulnerability in question, identified as OSV-2020-969, affects the pgp_parse_algo_attr_blob function in OpenSC. This function is responsible for parsing algorithm attribute blobs in the Pretty Good Privacy (PGP) protocol. The vulnerability allows for a stack-buffer-overflow WRITE 4, which can lead to a crash or potentially be exploited by an attacker to execute arbitrary code.

Vulnerability Detail

The vulnerability originates from a stack-buffer-overflow WRITE 4 in the pgp_parse_algo_attr_blob function. When processing a specially crafted algorithm attribute blob, the function fails to properly validate the size of the buffer, resulting in a buffer overflow. This can overwrite adjacent memory and potentially lead to a crash or arbitrary code execution. The vulnerability was discovered through an OSS-Fuzz report and has been assigned a severity rating of HIGH. The exact range of affected versions is unknown, but it was introduced at commit c4dcac5de77825e79763c9cd5f58aa8bde22f0b2 and fixed at commit 333c41c5d51450177553b8fd8cb2d710a7f7dec5 in the OpenSC GitHub repository.

How To Fix

Minimum fixed version

333c41c5d51450177553b8fd8cb2d710a7f7dec5

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 workaround, users can avoid the vulnerability by disabling or not using the affected functionality related to the pgp_parse_algo_attr_blob function. This can be achieved by modifying the code or configuration of the application that utilizes OpenSC.

Conclusion

In conclusion, the pgp_parse_algo_attr_blob function in OpenSC is vulnerable to a stack-buffer-overflow WRITE 4, which can result in a crash or arbitrary code execution. It is recommended to update the OpenSC package to a fixed version or apply a workaround to mitigate the risk. For further assistance with 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.

The vulnerability can lead to a crash or potentially be exploited by an attacker to execute arbitrary code.

The vulnerability was discovered through an OSS-Fuzz report.

The vulnerability has been assigned a severity rating of HIGH.

To fix this vulnerability, update the OpenSC package to a version that includes the fix commit 333c41c5d51450177553b8fd8cb2d710a7f7dec5 or later.

Related vulnerabilities

Recent vulnerabilities recorded for opensc.

How To Fix

Minimum fixed version

333c41c5d51450177553b8fd8cb2d710a7f7dec5

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