Uninitialized Bytes Exposure in Rust Standard Library
Summary
CVE-2020-36323: In the standard library in Rust before 1.52.0, there is an optimization for joining strings that can cause uninitialized bytes to be exposed (or the program to crash) if the borrowed string changes after its length is ch... Affects rust across 2 version ranges.
< 1.51.0-r2
< 88f19c6dab716c6281af7602e30f413e809c5974
Fixed in 1.51.0-r2. 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
The Rust programming language is known for its focus on memory safety and performance. It provides a standard library that offers various functionalities to developers. However, a vulnerability has been discovered in the Rust standard library before version 1.52.0. This vulnerability can lead to uninitialized bytes being exposed or cause the program to crash if a borrowed string changes after its length is checked.
Vulnerability Detail
The vulnerability (CVE-2020-36323) in the Rust standard library arises from an optimization for joining strings. When a borrowed string's length is checked, if the string changes, uninitialized bytes may be exposed or the program may crash. This can potentially lead to information disclosure or denial of service attacks. The vulnerability has a CVSSv3 score of 8.2, indicating a high severity.
How To Fix
Minimum fixed version
1.51.0-r2
This is the first release that contains the fix.
sudo apk add --upgrade rust
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no specific workaround mentioned for this vulnerability. The recommended approach is to update the Rust standard library to the fixed version.
Conclusion
The uninitialized bytes exposure vulnerability in the Rust standard library can have serious consequences, including information disclosure and denial of service attacks. It is crucial to update to the fixed version (1.52.0 or later) of the library to mitigate this vulnerability. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for rust →
FAQ
The vulnerability can lead to uninitialized bytes being exposed or cause the program to crash. This can potentially result in information disclosure or denial of service attacks.
You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities without requiring access to the code or installation.
The CVSSv3 score of this vulnerability is 8.2, indicating a high severity.
Yes, the fix for this vulnerability is available in the Rust standard library version 1.52.0 or later. It is recommended to update to the fixed version.
No specific workarounds are mentioned for this vulnerability. Updating to the fixed version of the Rust standard library is the recommended solution.
References
Related vulnerabilities
Recent vulnerabilities recorded for rust.