Stack Exhaustion in yaml-cpp (CVE-2019-6292)
Summary
CVE-2019-6292: An issue was discovered in singledocparser.cpp in yaml-cpp (aka LibYaml-C++) 0.6.2. Affects yaml-cpp across 2 version ranges.
< 0.6.3-1
< 562aefc114938e388457e6a531ed7b54d9dc1b62
Fixed in 0.6.3-1. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
yaml-cpp is a C++ library for parsing and emitting YAML (YAML Ain't Markup Language) files. It provides functionality for reading and writing YAML files in a simple and intuitive manner. The library is widely used in various applications and systems that require YAML file processing. However, a vulnerability has been discovered in yaml-cpp version 0.6.2, which can lead to stack exhaustion and denial-of-service attacks.
Vulnerability Detail
The vulnerability (CVE-2019-6292) originates from a stack consumption problem caused by recursive stack frames in the YAML::SingleDocParser component of yaml-cpp. Specifically, the following functions are affected: HandleCompactMap, HandleMap, HandleFlowSequence, HandleSequence, and HandleNode. This vulnerability can be exploited by remote attackers to trigger a denial-of-service condition by providing a specially crafted YAML file. The excessive stack consumption can exhaust the available stack space, leading to a crash or system instability.
How To Fix
Minimum fixed version
0.6.3-1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade yaml-cpp
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can avoid processing untrusted or unknown YAML files until the library is updated to a fixed version. By limiting the exposure to potentially malicious YAML files, the risk of exploitation can be reduced. However, this workaround may not be feasible in all scenarios, especially when YAML file processing is an essential part of the application or system functionality.
Conclusion
The vulnerability in yaml-cpp (CVE-2019-6292) can lead to stack exhaustion and denial-of-service attacks. It is crucial to update to the latest version of yaml-cpp (0.6.3-1 or later) to fix the vulnerability and ensure the proper handling of YAML files. Users should also exercise caution when processing YAML files from untrusted sources. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for yaml-cpp →
FAQ
yaml-cpp is a C++ library for parsing and emitting YAML files. It provides a convenient interface for working with YAML data in C++ applications.
The vulnerability can lead to a denial-of-service condition, causing the affected application or system to crash or become unstable. This can result in service disruption and potential data loss.
You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and Vulert will analyze it for any open-source vulnerabilities, including this one.
Yes, a fix is available in yaml-cpp version 0.6.3-1 or later. It is recommended to update your yaml-cpp installation to the latest version to mitigate the risk of exploitation.
As a temporary workaround, you can avoid processing untrusted or unknown YAML files until the library is updated. This can help reduce the risk of exploitation. However, it may not be feasible in all scenarios.
Related vulnerabilities
Recent vulnerabilities recorded for yaml-cpp.