Advisory

RUSTSEC-2021-0022

Also known as: CVE-2021-27377, GHSA-9658-c26v-7qvf

Summary

Use-after-free in subscript_next and subscript_prev wrappers

Details

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.

Severity

Critical Basis: CVSS v3 score 9.8, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Dates

Published
2021-02-09 12:00 UTC
Modified
2023-11-08 04:05 UTC

Affected packages and fixes

yottadb

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 1.2.0 (semver)

Fixed versions

1.2.0

Fix

  • Fixed version 1.2.0
    cargo update -p yottadb --precise 1.2.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences