Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. borsh
  4. ›
  5. GHSA-fjx5-qpf4-xjf2

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

April 17, 2023 (updated September 23, 2024)

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.

References

  • github.com/advisories/GHSA-fjx5-qpf4-xjf2
  • github.com/near/borsh-rs
  • github.com/near/borsh-rs/issues/19
  • rustsec.org/advisories/RUSTSEC-2023-0033.html

Code Behaviors & Features

Detect and mitigate GHSA-fjx5-qpf4-xjf2 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 1.0.0-alpha.1

Fixed versions

  • 1.0.0-alpha.1

Solution

Upgrade to version 1.0.0-alpha.1 or above.

Source file

cargo/borsh/GHSA-fjx5-qpf4-xjf2.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:04 +0000.