Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
github-actions bot opened this issue Dec 12, 2023 · 0 comments

Comments

@github-actions
Copy link

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

Details
Status unsound
Package borsh
Version 0.9.3
URL near/borsh-rs#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants