Skip to content

Commit

Permalink
fix(plugins): address potential security issue (#2830)
Browse files Browse the repository at this point in the history
* set static_memory_bound to 0
* add explanatory comment
  • Loading branch information
tlinford authored Oct 2, 2023
1 parent 7ccefc0 commit 9f130a3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion zellij-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -910,8 +910,17 @@ fn init_session(

#[cfg(not(feature = "singlepass"))]
fn get_store() -> Store {
use wasmer::{BaseTunables, Cranelift, Engine, Pages, Target};
log::info!("Compiling plugins using Cranelift");
Store::new(wasmer::Cranelift::default())

// workaround for https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-ff4p-7xrq-q5r8
let mut tunables = BaseTunables::for_target(&Target::default());
tunables.static_memory_bound = Pages(0);
let compiler = Cranelift::default();
let mut engine: Engine = compiler.into();
engine.set_tunables(tunables);

Store::new(engine)
}

#[cfg(feature = "singlepass")]
Expand Down

0 comments on commit 9f130a3

Please sign in to comment.