tari-project / tari-launchpad

A node, wallet and miner for Tari focusing on ease of use
BSD 3-Clause "New" or "Revised" License
8 stars 15 forks source link

RUSTSEC-2023-0033: Parsing borsh messages with ZST which are not-copy/clone is unsound #275

Open github-actions[bot] opened 6 months ago

github-actions[bot] commented 6 months ago

Parsing borsh messages with ZST which are not-copy/clone is unsound

Details
Status unsound
Package borsh
Version 0.9.3
URL https://github.com/near/borsh-rs/issues/19
Date 2023-04-12

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.

There is currently no way for borsh to read data without also providing a Rust type. Therefore, if not ZST are used for serialization, then you are not affected by this issue.

See advisory page for additional details.