Skip to content

GHSA-fjx5-qpf4-xjf2 Parsing borsh messages with ZST which are not-copy/clone is unsound

Unknown
Published
Updated
Exploit status
No public exploit known

Description

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 you are not using ZST for serialization, then you are not affected by this issue.

Upgrade path

1 package: 1 fixed.

PackageAffectedFixed inStatus
crates.io borsh(crates.io) < 1.0.0-alpha.1; <= 0.10.3; >= 0.0.0-0, < 0.10.4; >= 0.11.0-0, < 1.0.0-alpha.1 0.10.4, 1.0.0-alpha.1 Fixed

Affected products

ProductAffected versionsFixed in
crates.io borsh(crates.io) <= 0.10.3 No fix listed
crates.io borsh(crates.io) < 1.0.0-alpha.1 1.0.0-alpha.1
crates.io borsh(crates.io) >= 0.0.0-0, < 0.10.4 0.10.4
crates.io borsh(crates.io) >= 0.11.0-0, < 1.0.0-alpha.1 1.0.0-alpha.1

References