{"id":"CVE-2021-45697","aliases":["CVE-2021-45697","GHSA-6p3c-v8vc-c244","GHSA-82hm-vh7g-hrh9","RUSTSEC-2021-0103"],"related":[],"kind":"vulnerability","state":"published","title":"The `total_size` function for partial read the length of any `FixVec` is incorrect in molecule.","summary":"An issue was discovered in the molecule crate before 0.7.2 for Rust. A FixVec partial read has an incorrect result.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the molecule crate before 0.7.2 for Rust. A FixVec partial read has an incorrect result.","source":"cvelist"},{"lang":"en","text":"Anyone who uses total_size(..) function to partial read the length of any FixVec will get an incorrect result, due to an incorrect implementation. This has been resolved in the 0.7.2 release.","format":"markdown","source":"ghsa"},{"lang":"en","text":"### Impact\n\nAnyone who uses `total_size(..)` function to partial read the length of any `FixVec` will get an incorrect result, due to an incorrect implementation. This has been resolved in the 0.7.2 release.\n\n### Workarounds\n\nIf you already have the whole `FixVec` `A`, you can use `A.as_slice().len()` to get the total size of the `FixVec`.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n- [Open an issue to ask use directly](https://github.com/nervosnetwork/molecule/issues/new).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Se ha detectado un problema en la crate molecule versiones anteriores a 0.7.2 para Rust. Una lectura parcial de FixVec presenta un resultado incorrecto","source":"nvd"}],"published":"2021-07-30T12:00:00.000Z","modified":"2026-10-12T18:00:03.464Z","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":"GitHub","scheme":"rating","rating":"MEDIUM"},{"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":[],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.7.2"}],"ecosystem":"crates.io","package":"molecule","purl":"pkg:cargo/molecule","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.7.2"}],"ecosystem":"crates.io","package":"molecule","purl":"pkg:cargo/molecule","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.7.2"}],"ecosystem":"crates.io","package":"molecule","purl":"pkg:cargo/molecule","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.7.2"}],"vendor":"nervos","product":"molecule","cpe":"cpe:2.3:a:nervos:molecule:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0103.html","tags":["advisory","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/molecule/RUSTSEC-2021-0103.md","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nervosnetwork/molecule/security/advisories/GHSA-82hm-vh7g-hrh9","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45697","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nervosnetwork/molecule/pull/49","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/nervosnetwork/molecule","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/molecule","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-45697","url":"https://www.cve.org/CVERecord?id=CVE-2021-45697","licence":"CVE Terms of Use","modified":"2024-08-04T04:47:01.796Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6p3c-v8vc-c244","url":"https://github.com/advisories/GHSA-6p3c-v8vc-c244","licence":"CC-BY-4.0","modified":"2023-11-08T04:07:22.503Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-82hm-vh7g-hrh9","url":"https://github.com/advisories/GHSA-82hm-vh7g-hrh9","licence":"CC-BY-4.0","modified":"2023-11-08T04:07:22.503Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0103","url":"https://rustsec.org/advisories/RUSTSEC-2021-0103.html","licence":"CC0-1.0","modified":"2026-10-12T18:00:03.464Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-45697","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45697","licence":"Public domain","modified":"2026-06-17T04:13:58.100Z"}],"updatedAt":"2026-11-25T22:58:06.266Z","epss":{"score":0.01361,"percentile":0.7256,"date":"2026-12-01T12:00:22.000Z"}}