CVE-2019-16140: Use-after-free in chttp
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.65384%
CWE
Published
8/25/2021
Updated
11/6/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 |
---|---|---|---|
chttp | rust | >= 0.1.1, < 0.1.3 | 0.1.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the From<Buffer> for Vec<u8> implementation where Vec::from_raw_parts was called on a temporary slice. The original code didn't account for slice ownership - when the slice went out of scope, it would deallocate the memory that the newly created Vec was referencing. The fix explicitly calls mem::forget(slice) to prevent this premature deallocation. The affected code is clearly shown in the pre-patch version of src/buffer.rs lines 192-195, making this the definitive vulnerable function.