{"id":"GHSA-fjx5-qpf4-xjf2","summary":"Parsing borsh messages with ZST which are not-copy/clone is unsound","details":"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. \n","aliases":["RUSTSEC-2023-0033"],"modified":"2024-09-23T16:34:09Z","published":"2023-04-17T16:32:26Z","database_specific":{"github_reviewed_at":"2023-04-17T16:32:26Z","nvd_published_at":null,"cwe_ids":[],"severity":"MODERATE","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/near/borsh-rs/issues/19"},{"type":"PACKAGE","url":"https://github.com/near/borsh-rs"},{"type":"WEB","url":"https://rustsec.org/advisories/RUSTSEC-2023-0033.html"}],"affected":[{"package":{"name":"borsh","ecosystem":"crates.io","purl":"pkg:cargo/borsh"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.0.0-alpha.1"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/04/GHSA-fjx5-qpf4-xjf2/GHSA-fjx5-qpf4-xjf2.json","last_known_affected_version_range":"\u003c= 0.10.3"}}],"schema_version":"1.9.0"}