Skip to content

Commit 991e57a

Browse files
petermetzmicoferdinand98
authored andcommitted
fix(keychain-memory-wasm): wee_alloc is Unmaintained GHSA-rc23-xxgq-x27g
Removed wee_alloc from being used entirely. The default Rust allocator will be used instead which is better maintained and poses less of a security threat. Fixes hyperledger-cacti#2352 Signed-off-by: Peter Somogyvari <[email protected]>
1 parent e462d4e commit 991e57a

File tree

3 files changed

+0
-15
lines changed

3 files changed

+0
-15
lines changed

packages/cactus-plugin-keychain-memory-wasm/src/main/rust/cactus-plugin-keychain-memory-wasm/Cargo.toml

-7
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ wasm-bindgen-futures = "0.4.28"
2323
# code size when deploying.
2424
console_error_panic_hook = { version = "0.1.6", optional = true }
2525

26-
# `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size
27-
# compared to the default allocator's ~10K. It is slower than the default
28-
# allocator, however.
29-
#
30-
# Unfortunately, `wee_alloc` requires nightly Rust when targeting wasm for now.
31-
wee_alloc = { version = "0.4.5", optional = true }
32-
3326
js-sys = "0.3.55"
3427
serde = { version = "1.0.130", features = ["derive"] }
3528
serde_json = "1.0.68"

packages/cactus-plugin-keychain-memory-wasm/src/main/rust/cactus-plugin-keychain-memory-wasm/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,3 @@ wasm-pack publish
6565
between WebAssembly and JavaScript.
6666
* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook)
6767
for logging panic messages to the developer console.
68-
* [`wee_alloc`](https://github.com/rustwasm/wee_alloc), an allocator optimized
69-
for small code size.

packages/cactus-plugin-keychain-memory-wasm/src/main/rust/cactus-plugin-keychain-memory-wasm/src/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ use std::collections::HashMap;
44
use serde::{Serialize, Deserialize};
55
use wasm_bindgen::prelude::*;
66

7-
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
8-
// allocator.
9-
#[cfg(feature = "wee_alloc")]
10-
#[global_allocator]
11-
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
12-
137
// We have to allow snake case because the JS side expects it.
148
#[allow(non_snake_case)]
159
#[wasm_bindgen]

0 commit comments

Comments
 (0)