9.8critical
Use-after-free in yottadb
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 1.37% (higher than 72% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-9658-c26v-7qvfRUSTSEC-2021-0022
Description
An issue was discovered in the yottadb crate before 1.2.0 for Rust. For some memory-allocation patterns, ydb_subscript_next_st and ydb_subscript_prev_st have a use-after-free.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| yottadb (crates.io) | before 1.2.0, from 0.0.0-0 before 1.2.0 | GitHub Advisory Database, RustSec Advisory Database |
| yottadb yottadb | before 1.2.0 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| RustSec Advisory Database | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
An issue was discovered in the yottadb crate before 1.2.0 for Rust. For some memory-allocation patterns, ydb_subscript_next_st and ydb_subscript_prev_st have a use-after-free.
RustSec Advisory Database
Affected versions of this crate had an unsound implementation which could pass
a pointer to freed memory to ydb_subscript_next_st and
ydb_subscript_prev_st if the variable and subscripts did not have enough
memory allocated on the first call to hold the next variable in the database.
For example, the following code had undefined behavior:
let mut key = Key::variable(String::from("a"));
Key::variable("averylongkeywithlotsofletters")
.set_st(YDB_NOTTP, Vec::new(), b"some val")
.unwrap();
key.sub_next_self_st(YDB_NOTTP, Vec::new()).unwrap();
yottadb has no reverse-dependencies on crates.io and there are no known
instances of this API being used incorrectly in practice. The fix is backwards
compatible.
The flaw was corrected by recalculating the pointer each time it was reallocated.
NVD (es)
Se detectó un problema en la crate yottadb versiones anteriores a 1.2.0 para Rust. Para algunos patrones de asignación de memoria, las funciones ydb_subscript_next_st y ydb_subscript_prev_st presentan un uso de la memoria previamente liberada
References
| https://rustsec.org/advisories/RUSTSEC-2021-0022.html | advisory, exploit, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-27377 | advisory | |
| https://gitlab.com/YottaDB/Lang/YDBRust | package | |
| https://gitlab.com/YottaDB/Lang/YDBRust/-/issues/40 | report, web | |
| https://crates.io/crates/yottadb | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-27377 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-9658-c26v-7qvf changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0022 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-27377 changed 2026-06-17 | Public domain |