Merge rust-bitcoin/rust-bitcoin#6896: Fix `cargo audit` findings
What changed, and why it matters
This is a routine dependency-maintenance merge that swaps out old, unmaintained helper libraries for newer, patched versions in the project's example embedded programs and benchmark harness. The changes are driven by automated security scanner warnings (cargo audit) about known issues in the old dependencies. The core rust-bitcoin library code is not directly changed, and the affected code is example/embedded firmware and benchmark tooling rather than production wallet logic.
No immediate action beyond normal review. Verify CI passes and cargo audit no longer reports the addressed advisories. Users of the rust-bitcoin library itself are not affected; only consumers of the embedded examples or benchmark harness benefit from the cleanup.
Security signals we found
cargo audit advisory remediation
dependency upgrade for known-vulnerable crate (rand 0.7 / jobserver)
dependency upgrade for known-vulnerable crate (crossbeam-epoch)
replacement of unmaintained embedded allocator (alloc-cortex-m -> embedded-alloc)
no changes to cryptographic or consensus logic
Evidence from the diff
The merge updates three areas: (1) embedded examples in bitcoin/embedded and hashes/embedded replace the deprecated alloc-cortex-m crate with embedded-alloc 0.7.0 (LlffHeap via the llff feature) and add a direct cortex-m dependency with critical-section-single-core to provide a critical-section implementation; (2) benches/Cargo.lock bumps crossbeam-epoch to 0.9.21 to address RUSTSEC-2026-0204; (3) Cargo-minimal.lock and Cargo-recent.lock bump rand to 0.9.5 and jobserver to 0.1.18, removing the vulnerable rand 0.7 path referenced in RUSTSEC-2026-0097. The diff is entirely lockfile and example-firmware dependency changes; no cryptographic or consensus code is modified.
Changed components
bitcoin/embedded example firmwarehashes/embedded example firmwarebenches benchmark harness lockfileCargo-minimal.lockCargo-recent.lockInspect captured patch +51 / −184
### Cargo-minimal.lock
@@ -14,12 +14,6 @@ version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
-[[package]]
-name = "autocfg"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23213af7601f0f2d929f73d2a772804562cb09063f50bba9c361f86d6a0376f8"
-
[[package]]
name = "base58ck"
version = "0.1.101"
@@ -363,12 +357,6 @@ dependencies = [
"cc",
]
-[[package]]
-name = "bitflags"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f5cde24d1b2e2216a726368b2363a273739c91f4e3eb4e0dd12d672d396ad989"
-
[[package]]
name = "bitflags"
version = "2.4.2"
@@ -381,16 +369,6 @@ version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60f0b0d4c0a382d2734228fd12b5a6b5dac185c60e938026fd31b265b94f9bd2"
-[[package]]
-name = "c2-chacha"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101"
-dependencies = [
- "lazy_static",
- "ppv-lite86",
-]
-
[[package]]
name = "cc"
version = "1.0.83"
@@ -401,12 +379,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "cfg-if"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
-
[[package]]
name = "cfg-if"
version = "1.0.0"
@@ -420,15 +392,6 @@ dependencies = [
"hex-conservative 1.1.0",
]
-[[package]]
-name = "cloudabi"
-version = "0.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
-dependencies = [
- "bitflags 1.0.0",
-]
-
[[package]]
name = "cpufeatures"
version = "0.2.5"
@@ -438,31 +401,13 @@ dependencies = [
"libc",
]
-[[package]]
-name = "fuchsia-cprng"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81f7f8eb465745ea9b02e2704612a9946a59fa40572086c6fd49d6ddcf30bf31"
-
-[[package]]
-name = "getrandom"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e738b1f02e4d17217cae7648e774c03a19cd9de18bc294c538cc3e780f8c3bbd"
-dependencies = [
- "cloudabi",
- "fuchsia-cprng",
- "libc",
- "winapi",
-]
-
[[package]]
name = "getrandom"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71393ecc86efbf00e4ca13953979ba8b94cfe549a4b74cc26d8b62f4d8feac2b"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"libc",
"wasi",
"windows-targets",
@@ -509,21 +454,13 @@ checksum = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
[[package]]
name = "jobserver"
-version = "0.1.16"
+version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f74e73053eaf95399bf926e48fc7a2a3ce50bd0eaaa2357d391e95b2dcdd4f10"
+checksum = "230ae9adf468173aecd4176c7233bddc84a15871a586c5971ace9a55f881c075"
dependencies = [
"libc",
- "log",
- "rand 0.7.0",
]
-[[package]]
-name = "lazy_static"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
-
[[package]]
name = "libc"
version = "0.2.155"
@@ -540,15 +477,6 @@ dependencies = [
"cc",
]
-[[package]]
-name = "log"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
-dependencies = [
- "cfg-if 0.1.2",
-]
-
[[package]]
name = "ppv-lite86"
version = "0.2.14"
@@ -575,37 +503,12 @@ dependencies = [
[[package]]
name = "rand"
-version = "0.7.0"
+version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d47eab0e83d9693d40f825f86948aa16eff6750ead4bdffc4ab95b8b3a7f052c"
+checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"
dependencies = [
- "getrandom 0.1.1",
- "libc",
- "rand_chacha 0.2.0",
- "rand_core 0.5.0",
- "rand_hc",
-]
-
-[[package]]
-name = "rand"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
-dependencies = [
- "rand_chacha 0.9.0",
- "rand_core 0.9.0",
- "zerocopy",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e193067942ef6f485a349a113329140d0ab9e2168ce92274499bb0e9a4190d9d"
-dependencies = [
- "autocfg",
- "c2-chacha",
- "rand_core 0.5.0",
+ "rand_chacha",
+ "rand_core",
]
[[package]]
@@ -615,16 +518,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
dependencies = [
"ppv-lite86",
- "rand_core 0.9.0",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "615e683324e75af5d43d8f7a39ffe3ee4a9dc42c5c701167a71dc59c3a493aca"
-dependencies = [
- "getrandom 0.1.1",
+ "rand_core",
]
[[package]]
@@ -633,19 +527,10 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff"
dependencies = [
- "getrandom 0.3.0",
+ "getrandom",
"zerocopy",
]
-[[package]]
-name = "rand_hc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
-dependencies = [
- "rand_core 0.5.0",
-]
-
[[package]]
name = "ryu"
version = "1.0.0"
@@ -670,7 +555,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "519be132ce0792413872b1f2606f0fd8cbcf305c7120127704c60085c9bd4d63"
dependencies = [
"arbitrary",
- "rand 0.9.0",
+ "rand",
"secp256k1-sys 0.14.0",
"serde",
]
@@ -765,32 +650,10 @@ version = "0.13.0+wasi-0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "652cd73449d0b957a2743b70c72d79d34a5fa505696488f4ca90b46f6da94118"
dependencies = [
- "bitflags 2.4.2",
+ "bitflags",
"wit-bindgen-rt",
]
-[[package]]
-name = "winapi"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
[[package]]
name = "windows-targets"
version = "0.52.0"
### Cargo-recent.lock
@@ -497,9 +497,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "rand"
-version = "0.9.2"
+version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
+checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"
dependencies = [
"rand_chacha",
"rand_core",
### benches/Cargo.lock
@@ -343,9 +343,9 @@ dependencies = [
[[package]]
name = "crossbeam-epoch"
-version = "0.9.18"
+version = "0.9.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
+checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
dependencies = [
"crossbeam-utils",
]
@@ -532,9 +532,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "rand"
-version = "0.9.2"
+version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
+checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"
dependencies = [
"rand_chacha",
"rand_core",
### bitcoin/embedded/Cargo.lock
@@ -2,16 +2,6 @@
# It is not intended for manual editing.
version = 4
-[[package]]
-name = "alloc-cortex-m"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "483c3bd0f9a7bb982b72988f5f173d29687c432d8013c1d3232635e6c0f0a60c"
-dependencies = [
- "cortex-m",
- "linked_list_allocator",
-]
-
[[package]]
name = "arrayvec"
version = "0.7.8"
@@ -257,10 +247,21 @@ checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"
name = "embedded"
version = "0.1.0"
dependencies = [
- "alloc-cortex-m",
"bitcoin",
+ "cortex-m",
"cortex-m-rt",
"cortex-m-semihosting",
+ "embedded-alloc",
+]
+
+[[package]]
+name = "embedded-alloc"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2db634e07f552215f7a3572dc0a4d29760c637fcea5a8c18d2cc291f782c216c"
+dependencies = [
+ "critical-section",
+ "linked_list_allocator",
]
[[package]]
### bitcoin/embedded/Cargo.toml
@@ -15,7 +15,8 @@ nightly = "nightly-2026-07-02"
[dependencies]
cortex-m-rt = "0.6.10"
cortex-m-semihosting = "0.3.3"
-alloc-cortex-m = "0.4.1"
+cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
+embedded-alloc = { version = "0.7.0", default-features = false, features = ["llff"] }
bitcoin = { path="../", default-features = false, features = ["secp-lowmemory"] }
[lints.clippy]
### bitcoin/embedded/src/main.rs
@@ -9,15 +9,15 @@ extern crate bitcoin;
use alloc::string::ToString;
use core::panic::PanicInfo;
-use alloc_cortex_m::CortexMHeap;
// use panic_halt as _;
use bitcoin::{Address, AddressParams, WifKey};
use cortex_m_rt::entry;
use cortex_m_semihosting::{debug, hprintln};
+use embedded_alloc::LlffHeap;
// this is the allocator the application will use
#[global_allocator]
-static ALLOCATOR: CortexMHeap = CortexMHeap::empty();
+static ALLOCATOR: LlffHeap = LlffHeap::empty();
const HEAP_SIZE: usize = 1024 * 256; // 256 KB
### hashes/embedded/Cargo.lock
@@ -2,16 +2,6 @@
# It is not intended for manual editing.
version = 4
-[[package]]
-name = "alloc-cortex-m"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "483c3bd0f9a7bb982b72988f5f173d29687c432d8013c1d3232635e6c0f0a60c"
-dependencies = [
- "cortex-m",
- "linked_list_allocator",
-]
-
[[package]]
name = "arrayvec"
version = "0.7.8"
@@ -128,14 +118,25 @@ checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"
name = "embedded"
version = "0.1.0"
dependencies = [
- "alloc-cortex-m",
"bitcoin-io",
"bitcoin_hashes",
+ "cortex-m",
"cortex-m-rt",
"cortex-m-semihosting",
+ "embedded-alloc",
"panic-halt",
]
+[[package]]
+name = "embedded-alloc"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2db634e07f552215f7a3572dc0a4d29760c637fcea5a8c18d2cc291f782c216c"
+dependencies = [
+ "critical-section",
+ "linked_list_allocator",
+]
+
[[package]]
name = "embedded-hal"
version = "0.2.7"
### hashes/embedded/Cargo.toml
@@ -13,14 +13,15 @@ members = ["."]
nightly = "nightly-2026-07-02"
[features]
-alloc = ["alloc-cortex-m", "bitcoin_hashes/alloc"]
+alloc = ["cortex-m", "embedded-alloc", "bitcoin_hashes/alloc"]
hex = ["bitcoin_hashes/hex"]
[dependencies]
cortex-m-rt = "0.6.10"
cortex-m-semihosting = "0.3.3"
panic-halt = "0.2.0"
-alloc-cortex-m = { version = "0.4.1", optional = true }
+cortex-m = { version = "0.7.6", features = ["critical-section-single-core"], optional = true }
+embedded-alloc = { version = "0.7.0", default-features = false, features = ["llff"], optional = true }
bitcoin_hashes = { path="../", default-features = false, features = [] }
bitcoin-io = { path = "../../io", default_features = false, features = ["hashes"] }
### hashes/embedded/src/main.rs
@@ -10,14 +10,14 @@ extern crate alloc;
#[cfg(feature = "alloc")]
use alloc::string::ToString;
-#[cfg(feature = "alloc")]
-use alloc_cortex_m::CortexMHeap;
use bitcoin_hashes::{sha256, HashEngine};
use bitcoin_io::Write;
use cortex_m_rt::entry;
use cortex_m_semihosting::debug;
#[cfg(feature = "hex")]
use cortex_m_semihosting::hprintln;
+#[cfg(feature = "alloc")]
+use embedded_alloc::LlffHeap;
use panic_halt as _;
hash_newtype! {
@@ -32,7 +32,7 @@ bitcoin_hashes::impl_debug_only_for_newtype!(TestType);
// this is the allocator the application will use
#[cfg(feature = "alloc")]
#[global_allocator]
-static ALLOCATOR: CortexMHeap = CortexMHeap::empty();
+static ALLOCATOR: LlffHeap = LlffHeap::empty();
#[cfg(feature = "alloc")]
const HEAP_SIZE: usize = 1024; // in bytesWhy this scored 37/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.