{"id":"GHSA-fjx5-qpf4-xjf2","aliases":["GHSA-fjx5-qpf4-xjf2","RUSTSEC-2023-0033"],"related":[],"kind":"vulnerability","state":"published","title":"Parsing borsh messages with ZST which are not-copy/clone is unsound","summary":"Affected versions of borsh cause undefined behavior when zero-sized-types (ZST) are parsed and the Copy/Clone traits are not implemented/derived. For instance if 1000 instances of a ZST are deserialized, and the ZST is not copy (this can be achieved through a singleton), then accessing/writing to deserialized data will cause a segmentation fault.\n\nThere is currently no way for borsh to read data without also providing a Rust type. Therefore, if you are not using ZST for serialization, then you are not affected by this issue.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"Affected versions of borsh cause undefined behavior when zero-sized-types (ZST) are parsed and the Copy/Clone traits are not implemented/derived. For instance if 1000 instances of a ZST are deserialized, and the ZST is not copy (this can be achieved through a singleton), then accessing/writing to deserialized data will cause a segmentation fault.\n\nThere is currently no way for borsh to read data without also providing a Rust type. Therefore, if you are not using ZST for serialization, then you are not affected by this issue.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Affected versions of borsh cause undefined behavior when zero-sized-types (ZST) \nare parsed and the Copy/Clone traits are not implemented/derived.\nFor instance if 1000 instances of a ZST are deserialized, and the ZST is not copy \n(this can be achieved through a singleton), then accessing/writing to deserialized \ndata will cause a segmentation fault.\n\nThere is currently no way for borsh to read data without also providing a Rust type. \nTherefore, if not ZST are used for serialization, then you are not affected by this issue.","format":"markdown","source":"rustsec"}],"published":"2023-04-12T12:00:00.000Z","modified":"2024-09-23T16:34:09.000Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.0.0-alpha.1"}],"ecosystem":"crates.io","package":"borsh","purl":"pkg:cargo/borsh","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.10.4"},{"type":"semver","introduced":"0.11.0-0","status":"affected","fixed":"1.0.0-alpha.1"}],"ecosystem":"crates.io","package":"borsh","purl":"pkg:cargo/borsh","source":"rustsec"}],"references":[{"url":"https://github.com/near/borsh-rs/issues/19","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/near/borsh-rs","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2023-0033.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/borsh","tags":["package"],"sources":["rustsec"]},{"url":"https://github.com/near/borsh-rs/pull/136","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fjx5-qpf4-xjf2","url":"https://github.com/advisories/GHSA-fjx5-qpf4-xjf2","licence":"CC-BY-4.0","modified":"2024-09-23T16:34:09.000Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2023-0033","url":"https://rustsec.org/advisories/RUSTSEC-2023-0033.html","licence":"CC0-1.0","modified":"2024-09-23T15:02:17.000Z"}],"updatedAt":"2026-11-25T22:56:43.146Z"}