Miggo Logo

GHSA-q669-2vfg-cxcg: Nervos CKB Unaligned Pointer Dereference

N/A

CVSS Score

Basic Information

CVE ID
-
EPSS Score
-
CWE
-
Published
2/2/2024
Updated
2/2/2024
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
ckbrust<= 0.31.00.31.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from unsafe pointer casts from byte arrays to native integer pointers (u32/u64/u128) followed by immediate dereferencing. This violates Rust's alignment requirements, creating undefined behavior. The commit diff shows these patterns were replaced with safe byte array copying using from_le_bytes/from_be_bytes, confirming the original implementations were vulnerable. The affected functions are clearly identified in protocol message decoding and primitive type conversion implementations where raw pointer manipulation occurred.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

vi* *ounty@n*rvos.or* T**r* *r* multipl* typ* *onv*rsions in *k* t**t uns***ly **st **tw**n *yt* point*rs *n* ot**r typ*s o* point*rs. T*is r*sults in un*li*n** point*rs, w*i** *r* not *llow** *y t** Rust l*n*u***, *n* *r* *onsi**r** un***in** ****v

Reasoning

T** vuln*r**ility st*ms *rom uns*** point*r **sts *rom *yt* *rr*ys to n*tiv* int***r point*rs (u**/u**/u***) *ollow** *y imm**i*t* **r***r*n*in*. T*is viol*t*s Rust's *li*nm*nt r*quir*m*nts, *r**tin* un***in** ****vior. T** *ommit *i** s*ows t**s* p*