CVE-2021-27377
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
yottadb (crates.io)before 1.2.0, from 0.0.0-0 before 1.2.0GitHub Advisory Database, RustSec Advisory Database
yottadb yottadbbefore 1.2.0NVD

All scores

GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
RustSec Advisory Database9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.5high CVSS:2.0AV: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

Sources

SourceRecordLicence
CVE ListCVE-2021-27377 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-9658-c26v-7qvf changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0022 changed 2023-11-08CC0-1.0
NVDCVE-2021-27377 changed 2026-06-17Public domain