{"id":"CVE-2020-35865","aliases":["EUVD-2021-1837","GHSA-q948-x8rf-888m","RUSTSEC-2020-0012"],"status":"published","title":"os_str_bytes relies on undefined behavior of `char::from_u32_unchecked`","description":"An issue was discovered in the os_str_bytes crate before 2.0.0 for Rust. It has false expectations about char::from_u32_unchecked behavior.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-10","score":0.01352,"percentile":0.71786,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-704"],"published":"2020-04-24T12:00:00Z","modified":"2026-10-24T10:30:36Z","fixes":[{"ecosystem":"crates.io","package":"os_str_bytes","fixed_in":["2.0.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"os_str_bytes","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.0"}]}]},{"source":"osv","ecosystem":"crates.io","package":"os_str_bytes","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.0.0"}]}]},{"source":"osv","ecosystem":"crates.io","package":"os_str_bytes","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"2.0.0"}]}]}],"products":[{"vendor":"os_str_bytes_project","product":"os_str_bytes"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2020-0012.html","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-35865","tags":["advisory"]},{"url":"https://github.com/dylni/os_str_bytes/pull/1","tags":["web"]},{"url":"https://github.com/advisories/GHSA-q948-x8rf-888m"},{"url":"https://github.com/dylni/os_str_bytes","tags":["package"]},{"url":"https://crates.io/crates/os_str_bytes","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2020-35865","description":"An issue was discovered in the os_str_bytes crate before 2.0.0 for Rust. It has false expectations about char::from_u32_unchecked behavior.","status":"published","published":"2020-12-31T08:29:20Z","modified":"2024-08-04T17:16:12.645Z","updated_at":"2026-11-02T14:35:58.331892Z"}],"euvd":[{"id":"EUVD-2021-1837","description":"An issue was discovered in the os_str_bytes crate before 2.0.0 for Rust. It has false expectations about char::from_u32_unchecked behavior.","status":"published","published":"2020-12-31T08:29:20Z","modified":"2024-08-04T17:16:12Z","updated_at":"2026-11-03T03:07:04.595509Z"}],"ghsa":[{"id":"GHSA-q948-x8rf-888m","title":"os_str_bytes relies on undefined behavior of `char::from_u32_unchecked`","description":"The Windows implementation of this crate relied on the behavior of std::char::from_u32_unchecked when its safety clause is violated. Even though this worked with Rust versions up to 1.42 (at least), that behavior could change with any new Rust version, possibly leading a security issue.\n\nThe flaw was corrected in version 2.0.0.","status":"published","published":"2021-08-25T20:47:55Z","modified":"2023-06-13T20:12:22Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-704"],"updated_at":"2026-11-02T14:36:53.654352Z"}],"nvd":[{"id":"CVE-2020-35865","description":"An issue was discovered in the os_str_bytes crate before 2.0.0 for Rust. It has false expectations about char::from_u32_unchecked behavior.","status":"published","published":"2020-12-31T10:15:15.223Z","modified":"2026-06-17T03:14:29.523Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"primary"},{"version":"2.0","score":5,"vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","level":"medium","assessor":"primary"}],"updated_at":"2026-11-02T14:06:28.340168Z"}],"osv":[{"id":"CVE-2020-35865","description":"An issue was discovered in the os_str_bytes crate before 2.0.0 for Rust. It has false expectations about char::from_u32_unchecked behavior.","status":"published","published":"2020-12-31T10:15:15.223Z","modified":"2026-10-24T10:30:36.849349041Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:44:16.612899Z"},{"id":"GHSA-q948-x8rf-888m","title":"os_str_bytes relies on undefined behavior of `char::from_u32_unchecked`","description":"The Windows implementation of this crate relied on the behavior of std::char::from_u32_unchecked when its safety clause is violated. Even though this worked with Rust versions up to 1.42 (at least), that behavior could change with any new Rust version, possibly leading a security issue.\n\nThe flaw was corrected in version 2.0.0.","status":"published","published":"2021-08-25T20:47:55Z","modified":"2023-11-08T04:03:36.337199Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-704"],"updated_at":"2026-11-02T15:46:54.40888Z"},{"id":"RUSTSEC-2020-0012","title":"Relies on undefined behavior of `char::from_u32_unchecked`","description":"The Windows implementation of this crate relied on the behavior of\n`std::char::from_u32_unchecked` when its safety clause is violated.\nEven though this worked with Rust versions up to 1.42 (at least),\nthat behavior could change with any new Rust version, possibly leading\na security issue.\n\nThe flaw was corrected in version 2.0.0.","status":"published","published":"2020-04-24T12:00:00Z","modified":"2023-11-08T04:03:36.337199Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:53:39.492624Z"}]}}
