{"id":"CVE-2021-27377","aliases":["CVE-2021-27377","GHSA-9658-c26v-7qvf","RUSTSEC-2021-0022"],"related":[],"kind":"vulnerability","state":"published","title":"Use-after-free in yottadb","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"Affected versions of this crate had an unsound implementation which could pass\na pointer to freed memory to `ydb_subscript_next_st` and\n`ydb_subscript_prev_st` if the variable and subscripts did not have enough\nmemory allocated on the first call to hold the next variable in the database.\n\nFor example, the following code had undefined behavior:\n\n```rust\nlet mut key = Key::variable(String::from(\"a\"));\nKey::variable(\"averylongkeywithlotsofletters\")\n    .set_st(YDB_NOTTP, Vec::new(), b\"some val\")\n    .unwrap();\nkey.sub_next_self_st(YDB_NOTTP, Vec::new()).unwrap();\n```\n\n`yottadb` has no reverse-dependencies on crates.io and there are no known\ninstances of this API being used incorrectly in practice. The fix is backwards\ncompatible.\n\nThe flaw was corrected by recalculating the pointer each time it was reallocated.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate yottadb versiones anteriores a 1.2.0 para Rust.&#xa0;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","source":"nvd"}],"published":"2021-02-09T12:00:00.000Z","modified":"2026-06-17T03:44:44.203Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.2.0"}],"ecosystem":"crates.io","package":"yottadb","purl":"pkg:cargo/yottadb","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"1.2.0"}],"ecosystem":"crates.io","package":"yottadb","purl":"pkg:cargo/yottadb","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"1.2.0"}],"vendor":"yottadb","product":"yottadb","cpe":"cpe:2.3:a:yottadb:yottadb:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0022.html","tags":["advisory","exploit","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-27377","tags":["advisory"],"sources":["ghsa"]},{"url":"https://gitlab.com/YottaDB/Lang/YDBRust","tags":["package"],"sources":["ghsa"]},{"url":"https://gitlab.com/YottaDB/Lang/YDBRust/-/issues/40","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/yottadb","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-27377","url":"https://www.cve.org/CVERecord?id=CVE-2021-27377","licence":"CVE Terms of Use","modified":"2024-08-03T20:48:16.468Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9658-c26v-7qvf","url":"https://github.com/advisories/GHSA-9658-c26v-7qvf","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:24.490Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0022","url":"https://rustsec.org/advisories/RUSTSEC-2021-0022.html","licence":"CC0-1.0","modified":"2023-11-08T04:05:24.490Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-27377","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-27377","licence":"Public domain","modified":"2026-06-17T03:44:44.203Z"}],"updatedAt":"2026-11-25T22:57:59.983Z","epss":{"score":0.01372,"percentile":0.72758,"date":"2026-12-01T12:00:22.000Z"}}