RUSTSEC-2024-0377

Source
https://rustsec.org/advisories/RUSTSEC-2024-0377
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2024-0377.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2024-0377
Published
2024-10-07T12:00:00Z
Modified
2024-10-08T23:13:59Z
Summary
Heap Buffer overflow using c_chars_to_str function
Details

The heap-buffer-overflow is triggered in the strlen() function when handling the c_chars_to_str function in the dbn crate. This vulnerability occurs because the CStr::from_ptr() function in Rust assumes that the provided C string is null-terminated. However, there is no guarantee that the input chars array passed to the ccharsto_str function is properly null-terminated.

If the chars array does not contain a null byte (\0), strlen() will continue to read beyond the bounds of the buffer in search of a null terminator. This results in an out-of-bounds memory read and can lead to a heap-buffer-overflow, potentially causing memory corruption or exposing sensitive information.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / dbn

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
0.22.1-0

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [],
        "arch": []
    }
}

Database specific

{
    "cvss": null,
    "informational": null,
    "categories": [
        "memory-corruption"
    ]
}