Denial of Service Vulnerability in yaml-cpp
Summary
CVE-2019-6285: The SingleDocParser::HandleFlowSequence function in yaml-cpp (aka LibYaml-C++) 0.6.2 allows remote attackers to cause a denial of service (stack consumption and application crash) via a crafted YAML file. 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 an open-source library for parsing and emitting YAML files. It is commonly used in various applications to handle YAML data. However, a vulnerability has been discovered in yaml-cpp version 0.6.2 that can lead to a denial of service attack.
Vulnerability Detail
The vulnerability, identified as CVE-2019-6285, exists in the SingleDocParser::HandleFlowSequence function of yaml-cpp. An attacker can exploit this vulnerability by providing a specially crafted YAML file. When the vulnerable function attempts to parse the malicious YAML file, it consumes excessive stack memory, leading to a stack overflow and subsequent application crash. This vulnerability can be exploited remotely, potentially impacting applications that use yaml-cpp to process user-supplied YAML data.
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
If upgrading to the latest version of yaml-cpp is not immediately feasible, a possible workaround is to implement input validation and sanitization mechanisms to filter out potentially malicious YAML files. By carefully validating and sanitizing user-supplied YAML data, the risk of exploitation can be mitigated. However, this workaround may not provide complete protection and upgrading to the fixed version is still strongly recommended.
Conclusion
In conclusion, the yaml-cpp library version 0.6.2 is vulnerable to a denial of service attack. To mitigate this vulnerability, it is recommended to upgrade to version 0.6.3-1 or later. Implementing input validation and sanitization mechanisms can provide temporary protection, but upgrading to the fixed version is the best long-term solution. For further support on vulnerability remediation, you can contact DevNack.com.
See every vulnerability recorded for yaml-cpp →
FAQ
yaml-cpp is an open-source library for parsing and emitting YAML files. It provides functionality to handle YAML data in various applications.
The vulnerability allows remote attackers to cause a denial of service by crashing the application using a specially crafted YAML file.
To fix this vulnerability, upgrade yaml-cpp to version 0.6.3-1 or later.
Implementing input validation and sanitization mechanisms can mitigate the risk, but upgrading to the fixed version is strongly recommended.
There is no known exploit available for this vulnerability at the moment.
Related vulnerabilities
Recent vulnerabilities recorded for yaml-cpp.