GHSA-fjx5-qpf4-xjf2: Borsh Parsing Borsh Messages With ZST Vulnerability
MODERATEGHSA-fjx5-qpf4-xjf2 is a MODERATE parsing borsh messages with zst vulnerability (General Security Weakness) affecting Borsh libraries in the crates.io ecosystem. The issue involves parsing borsh messages with zst which are not-copy/clone is unsound. Remediation is available by upgrading affected packages to version 1.0.0-alpha.1.
GHSA-fjx5-qpf4-xjf2 at a Glance
How to Fix GHSA-fjx5-qpf4-xjf2
To remediate this vulnerability, upgrade all affected Borsh dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade borsh to 1.0.0-alpha.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for borsh
How to Check if You Are Affected
To determine whether your application is affected by GHSA-fjx5-qpf4-xjf2, inspect your project dependencies for Borsh:
inspect dependencies for borsh
Analyze the terminal output to locate any version of Borsh in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.0-alpha.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under General Security Weakness. In Borsh, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-fjx5-qpf4-xjf2 Affected Borsh Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
borsh
|
crates.io |
< 1.0.0-alpha.1
|
1.0.0-alpha.1
|
References
Frequently Asked Questions
What is GHSA-fjx5-qpf4-xjf2?
Which Borsh versions are affected?
What version fixes GHSA-fjx5-qpf4-xjf2?
Is borsh affected?
What CWE is associated with GHSA-fjx5-qpf4-xjf2?
How can I check crates.io dependencies for GHSA-fjx5-qpf4-xjf2?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fjx5-qpf4-xjf2",
"modified" : "2024-09-23T16:34:09Z",
"published" : "2023-04-17T16:32:26Z",
"aliases" : [ ],
"summary" : "Parsing borsh messages with ZST which are not-copy/clone is unsound",
"details" : "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.\n\nThere 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. \n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "borsh"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.0.0-alpha.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.10.3"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/near/borsh-rs/issues/19"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/near/borsh-rs"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2023-0033.html"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-04-17T16:32:26Z",
"nvd_published_at" : null
}
}