Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2022-39393: Merge pull request from GHSA-wh6w-3828-g9qf · bytecodealliance/wasmtime@2614f2e

Wasmtime is a standalone runtime for WebAssembly. Prior to version 2.0.2, there is a bug in Wasmtime’s implementation of its pooling instance allocator where when a linear memory is reused for another instance the initial heap snapshot of the prior instance can be visible, erroneously to the next instance. This bug has been patched and users should upgrade to Wasmtime 2.0.2. Other mitigations include disabling the pooling allocator and disabling the memory-init-cow.

CVE
#web

@@ -615,6 +615,67 @@ fn drop_externref_global_during_module_init() -> Result<()> {

Ok(())

}

#[test]

fn switch_image_and_non_image() -> Result<()> {

let mut c = Config::new();

c.allocation_strategy(InstanceAllocationStrategy::Pooling {

instance_limits: InstanceLimits {

count: 1,

…Default::default()

},

strategy: Default::default(),

});

let engine = Engine::new(&c)?;

let module1 = Module::new(

&engine,

r#"

(module

(memory 1)

(func (export “load”) (param i32) (result i32)

local.get 0

i32.load

)

)

"#,

)?;

let module2 = Module::new(

&engine,

r#"

(module

(memory (export “memory”) 1)

(data (i32.const 0) “1234”)

)

"#,

)?;

let assert_zero = || -> Result<()> {

let mut store = Store::new(&engine, ());

let instance = Instance::new(&mut store, &module1, &[])?;

let func = instance.get_typed_func::<i32, i32, _>(&mut store, “load”)?;

assert_eq!(func.call(&mut store, 0)?, 0);

Ok(())

};

// Initialize with a heap image and make sure the next instance, without an

// image, is zeroed

Instance::new(&mut Store::new(&engine, ()), &module2, &[])?;

assert_zero()?;

// … transition back to heap image and do this again

Instance::new(&mut Store::new(&engine, ()), &module2, &[])?;

assert_zero()?;

// And go back to an image and make sure it’s read/write on the host.

let mut store = Store::new(&engine, ());

let instance = Instance::new(&mut store, &module2, &[])?;

let memory = instance.get_memory(&mut store, “memory”).unwrap();

let mem = memory.data_mut(&mut store);

assert!(mem.starts_with(b"1234"));

mem[…6].copy_from_slice(b"567890");

Ok(())

}

#[test]

#[cfg(target_pointer_width = “64”)]

fn instance_too_large() -> Result<()> {

Related news

GHSA-wh6w-3828-g9qf: Wasmtime may have data leakage between instances in the pooling allocator

### Impact There is a bug in Wasmtime's implementation of its pooling instance allocator where when a linear memory is reused for another instance the initial heap snapshot of the prior instance can be visible, erroneously to the next instance. The pooling instance allocator in Wasmtime works by preallocating virtual memory for a fixed number of instances to reside in and then new instantiations pick a slot to use. Most conventional modules additionally have an initial copy-on-write "heap image" which is mapped in Wasmtime into the linear memory slot. When a heap slot is deallocated Wasmtime resets all of its contents back to the initial state but it does not unmap the image in case the next instance is an instantiation of the same module. The bug in Wasmtime occurs when a slot in the pooling allocator previously was used for a module with a heap image, meaning that its current state of memory contains the initial heap contents of that module. If the next instantiation within that sl...

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907