GHSA-q669-2vfg-cxcg: Ckb Nervos CKB Unaligned Pointer Dereference Vulnerability
MODERATEGHSA-q669-2vfg-cxcg is a MODERATE nervos ckb unaligned pointer dereference vulnerability (General Security Weakness) affecting Ckb libraries in the crates.io ecosystem. The issue involves nervos ckb unaligned pointer dereference. Remediation is available by upgrading affected packages to version 0.31.1.
GHSA-q669-2vfg-cxcg at a Glance
How to Fix GHSA-q669-2vfg-cxcg
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.31.1
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-q669-2vfg-cxcg, 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.31.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 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-q669-2vfg-cxcg Affected Ckb Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ckb
|
crates.io |
< 0.31.1
|
0.31.1
|
References
Frequently Asked Questions
What is GHSA-q669-2vfg-cxcg?
Which Ckb versions are affected?
What version fixes GHSA-q669-2vfg-cxcg?
Is ckb affected?
What CWE is associated with GHSA-q669-2vfg-cxcg?
How can I check crates.io dependencies for GHSA-q669-2vfg-cxcg?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q669-2vfg-cxcg",
"modified" : "2024-02-02T20:59:17Z",
"published" : "2024-02-02T20:59:17Z",
"aliases" : [ ],
"summary" : "Nervos CKB Unaligned Pointer Dereference",
"details" : "via bounty@nervos.org\n\nThere are multiple type conversions in ckb that unsafely cast between byte pointers and other types of pointers. This results in unaligned pointers, which are not allowed by the Rust language, and are considered undefined behavior, meaning that the compiler is free to do anything with code. This can lead to unpredictable bugs that can become security vulnerabilities.\n\nSome of the bugs here could potentially lead to buffer overreads in malformed data (it's not clear to me as I haven't investigated the practical impact of these bugs).\n\nTwo of these (in blockchain.rs) do not create unaligned data. They do though perform an unsafe operation that may not uphold the invariants of the safe function they are in, and could lead to undefined behavior and buffer overreads on malformed input.\n\nThese are of the same nature as those in my previous report about the molecule crate.\n\nPatch attached for commit 1b09e37c8e1b7945495cd18d9782417fbe51e986 that fixes all cases I know of at this time.\n\nPlease consider this report for reward under the terms of the bug bounty program.\n\nRelated advisory: https://github.com/nervosnetwork/molecule/security/advisories/GHSA-rffv-8x7x-p7pw",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "ckb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.31.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.31.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nervosnetwork/ckb/security/advisories/GHSA-q669-2vfg-cxcg"
}, {
"type" : "WEB",
"url" : "https://github.com/nervosnetwork/ckb/commit/adf8f0d08bc058383a0df658ea2c2ef6e7950335"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-02-02T20:59:17Z",
"nvd_published_at" : null
}
}