Skip to content
Fencer Intel
medium —

GHSA-fjx5-qpf4-xjf2 json

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

published 3y ago modified 2y ago also RUSTSEC-2023-0033

cvss
—
not scored
cisa kev
Not listed
not in CISA's catalog
epss
—
no score, EPSS covers CVEs only
public exploits
0
none known

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.

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.

Patch / fix

  • crates.io borsh 0.10.4, 1.0.0-alpha.1

Is GHSA-fjx5-qpf4-xjf2 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Affected packages

ecosystem package affected fixed in
crates.io borsh
<1.0.0-alpha.1
>=0.0.0-0, <0.10.4
>=0.11.0-0, <1.0.0-alpha.1
1.0.0-alpha.1
0.10.4

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.