{"answers":{"affected":"2 open source packages ship an affected version, including ckb.","exploited":"There is no known exploitation of GHSA-q669-2vfg-cxcg in the wild and no public exploit code.","fix":"Upgrade ckb to 0.31.1 or later.","what":"GHSA-q669-2vfg-cxcg is a memory corruption vulnerability in ckb, published on 2 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-q669-2vfg-cxcg and fix it if it is affected.\n\nWhat it is: GHSA-q669-2vfg-cxcg is a memory corruption vulnerability in ckb, published on 2 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-q669-2vfg-cxcg in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- ckb (crates.io): affected all versions; fixed in 0.31.1\n- ckb (crates.io): affected all versions; fixed in 0.31.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-q669-2vfg-cxcg/ (Markdown: https://insights.sbomify.com/GHSA-q669-2vfg-cxcg/index.md)","id":"GHSA-q669-2vfg-cxcg","markdown":"https://insights.sbomify.com/GHSA-q669-2vfg-cxcg/index.md","name":"GHSA-q669-2vfg-cxcg","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"patch","impacts":["denial_of_service","data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Rust blockchain library","requires_auth":"none","summary":"Unaligned pointer dereferences in Nervos CKB library can cause undefined behavior and buffer overreads on malformed input, potentially leading to crashes or information disclosure.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"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","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Nervos CKB Unaligned Pointer Dereference","id":"GHSA-q669-2vfg-cxcg","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"memory_corruption","year":"2024"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["0.31.1"],"introduced":["0"],"last_affected":[],"package":"ckb","purl":null,"source":"GHSA-q669-2vfg-cxcg"},{"ecosystem":"crates.io","fixed":["0.31.1"],"introduced":["0"],"last_affected":[],"package":"ckb","purl":"pkg:cargo/ckb","source":"GHSA-q669-2vfg-cxcg"}],"products":null,"published":"2024-02-02","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Unaligned pointer dereferences in Nervos CKB library can cause undefined behavior and buffer overreads on malformed input, potentially leading to crashes or information disclosure.","url":"https://insights.sbomify.com/GHSA-q669-2vfg-cxcg/"}