Intel

AIKIDO-2026-868088

wasm-bindgen is vulnerable to Type Confusion

Type Confusion Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Yesterday

23

Low Risk

This Affects:

RUSTwasm-bindgen
0.2.0 - 0.2.122
Fixed in 0.2.123
Are you affected? Scan for Free

TL;DR

wasm-bindgen ships a blanket UpcastFrom<&mut T> implementation that lets code widen a &mut T reference into &mut Target for any two JS bound types, without requiring the reverse cast to also be valid. Application code that performs this mutable upcast and writes a value through the widened reference can store a value whose runtime type does not match the type expected by holders of the original &mut T, a type confusion. A later read gets a value with the wrong shape, which can corrupt program state or panic. The fix requires mutual upcastability (Target: UpcastFrom<T> and T: UpcastFrom<Target>) so only sound widenings compile.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your code performs a mutable reference upcast (Upcast/UpcastFrom) between two JS bound wrapper types.

Background info

wasm-bindgen is vulnerable to Type Confusion in versions 0.2.0 - 0.2.122.

How to fix this

Upgrade the wasm-bindgen library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform