fix: resolve security-audit rand unsound error (exit 0)#668
Open
eval-exec wants to merge 1 commit into
Open
Conversation
The rand 0.7.3 unsoundness (RUSTSEC-2026-0097) requires ALL of: - Calling rand::thread_rng() from inside a custom log::Log implementation - Trace-level logging active (or warn-level + getrandom failure) ckb-cli uses rand only in normal code paths (keystore salt generation, mock tx helper) — never inside a custom logger. The advisory is not exploitable here. Cannot semver-bump rand to 0.8 due to upstream deps pinning 0.7: ckb-vm, jsonrpc-pubsub, numext-fixed-uint-core. make security-audit now exits 0 with zero errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the sole
error-level finding frommake security-auditon the develop branch.Problem
make security-auditon develop fails with:Why this is a false positive
The unsoundness requires ALL of these conditions:
rand::thread_rng()/rand::rng()from inside a customlog::Logimplementationckb-cli uses
rand::thread_rng()only in normal code paths:ckb-signer/src/keystore— salt generation for key encryptionsrc/utils/mock_tx_helper.rs— random private key generationNone of these are inside a custom logger. The advisory is not exploitable.
Why not upgrade rand?
rand 0.7.3is pinned by upstream dependencies that cannot be semver-bumped:ckb-vmjsonrpc-pubsubnumext-fixed-uint-corephf_generator(build dep viaincludedir_codegen)The fix requires
rand >= 0.8.6, which is a semver-breaking change.Changes
RUSTSEC-2026-0097todeny.toml[advisories.ignore]with rationaleVerification
make security-auditexits 0, zero errorswarning[unmaintained]advisories remain (transitive deps)