CVE-2021-45690: Use of Uninitialized Resource in messagepack-rs.
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.61972%
CWE
Published
1/6/2022
Updated
6/13/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
messagepack-rs | rust | <= 0.8.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from 4 functions that:
- Create a Vec buffer with capacity
- Use unsafe { set_len } to expand without initialization
- Pass the uninitialized buffer to Read::read_exact
This violates Rust's safety requirements as Read implementations expect initialized buffers. The advisory explicitly lists these functions, and code examples confirm the unsafe pattern. The GitHub issue #2 provides direct evidence of the vulnerable code patterns in deserialize_binary/string, and the advisory extends this to include deserialize_extension_others and deserialize_string_primitive with the same vulnerability pattern.