wasm-pack icon indicating copy to clipboard operation
wasm-pack copied to clipboard

Lack of integrity verification of downloaded external dependencies

Open mensfeld opened this issue 3 years ago • 0 comments

Hey,

My name is Maciej Mensfeld and I run a research security project called WhiteSource Diffend.io.

I've noticed, that this library downloads some external releases and uses them. While it's a totally common pattern, what is lacking here is integrity verification.

You could verify the integrity of the downloaded file before using it by comparing the file hash to a hardcoded, expected file hash.

This is essentially what package managers do to verify the integrity of downloaded packages.

Doing this would prevent attack scenarios in which wasm-pack releases data is manipulated.

Have a great day :)

https://github.com/rustwasm/wasm-pack/blob/master/npm/binary.js#L28=

mensfeld avatar May 17 '22 14:05 mensfeld