CVE-2024-38358 Symlink bypasses filesystem sandbox in wasmer
A symlink bypass in the Wasmer runtime allows WASI programs to access the host filesystem or crash the runtime if specific flags are set.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2024-38358?
CVE-2024-38358 is a low-severity path traversal vulnerability in wasmerio wasmer, published on 19 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
Wasmer is a web assembly (wasm) Runtime supporting WASIX, WASI and Emscripten. If the preopened directory has a symlink pointing outside, WASI programs can traverse the symlink and access host filesystem if the caller sets both `oflags::creat` and `rights::fd_write`. Programs can also crash the runtime by creating a symlink pointing outside with `path_symlink` and `path_open`ing the link. This issue has been addressed in commit `b9483d022` which has been included in release version 4.3.2. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Weakness: CWE-22
Which versions are affected by CVE-2024-38358?
2 open source packages ship an affected version, including wasmer.
| Package | Affected | Fixed in |
|---|---|---|
wasmer crates.io | All versions to 4.3.1 | None |
wasmer crates.io | All versions to 4.3.1 | None |
How do I fix CVE-2024-38358?
No fix has been published for CVE-2024-38358 yet. Limit exposure of the affected software until one is available.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2024-38358 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-38358 exists.
Sources
Also known as GHSA-55f3-3qvg-8pv5.