Uninitialized Bytes Exposure in Rust Standard Library

rust Updated 02 Oct 2025

Summary

14/04/2021
N/A
Yes i
High
8.2

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 ↓

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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for rust.

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 →

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