GHSA-3gjh-29fv-8hr6: Ckb Nervos CKB Snappy Decompress Length Vulnerability
HIGHGHSA-3gjh-29fv-8hr6 is a HIGH nervos ckb snappy decompress length vulnerability (General Security Weakness) affecting Ckb libraries in the crates.io ecosystem. The issue involves nervos ckb snappy decompress length can be very large and causes out of memory error. Remediation is available by upgrading affected packages to version 0.34.2.
GHSA-3gjh-29fv-8hr6 at a Glance
How to Fix GHSA-3gjh-29fv-8hr6
To remediate this vulnerability, upgrade all affected Ckb 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 ckb to 0.34.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for ckb
How to Check if You Are Affected
To determine whether your application is affected by GHSA-3gjh-29fv-8hr6, inspect your project dependencies for Ckb:
inspect dependencies for ckb
Analyze the terminal output to locate any version of Ckb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.34.2), 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 Ckb, 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-3gjh-29fv-8hr6 Affected Ckb Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ckb
|
crates.io |
< 0.34.2
|
0.34.2
|
References
Frequently Asked Questions
What is GHSA-3gjh-29fv-8hr6?
Which Ckb versions are affected?
What version fixes GHSA-3gjh-29fv-8hr6?
Is ckb affected?
What CWE is associated with GHSA-3gjh-29fv-8hr6?
How can I check crates.io dependencies for GHSA-3gjh-29fv-8hr6?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3gjh-29fv-8hr6",
"modified" : "2024-02-03T00:18:10Z",
"published" : "2024-02-03T00:18:10Z",
"aliases" : [ ],
"summary" : "Nervos CKB Snappy decompress length can be very large and causes out of memory error ",
"details" : "### Impact\n\nAdversary can create message which compressed size is less than the package limit but the decompressed length is very large such as 1G. It will cost the node many memories to process the network messages, and on the system with less than 1G memory, the process is killed directly because of out of memory error.\n\n### Patches\n\nThe node must check the decompress length before allocating the memory for the message.\n\n### References\n\n* https://github.com/nervosnetwork/ckb/blob/687d797f1888dd05d1f38ce6d1bef3e5b9b6e38b/network/src/compress.rs#L68\n* https://github.com/BurntSushi/rust-snappy/blob/master/src/decompress.rs#L106\n* https://github.com/BurntSushi/rust-snappy/blob/6cfb836463b9b3ac48ca7cd15d0a50d030e95769/src/decompress.rs#L30",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "ckb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.34.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.34.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nervosnetwork/ckb/security/advisories/GHSA-3gjh-29fv-8hr6"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-02-03T00:18:10Z",
"nvd_published_at" : null
}
}