Miggo Logo

CVE-2023-51661: Wasmer filesystem sandbox not enforced

8.4

CVSS Score
3.1

Basic Information

EPSS Score
0.50317%
Published
12/13/2023
Updated
1/3/2024
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
wasmer-clirust>= 3.0.0, < 4.2.44.2.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from improper filesystem sandboxing in WASI directory mapping. The key functions are in the Wasi command handler where:

  1. The prepare() method set up environment without properly restricting default directory access
  2. build_mapped_directories() handled path mapping logic but previously allowed:
    • Implicit current directory mapping to host FS
    • Absolute path validation issues
    • Duplicate directory mapping checks These functions were modified in the patched commit to add proper sandbox enforcement through the MAPPED_CURRENT_DIR_DEFAULT_PATH constant and strict path validation, indicating they were the source of the vulnerability.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry *s o* W*sm*r v*rsion v*.*.*, W*sm pro*r*ms **n ****ss t** *il*syst*m outsi** o* t** s*n**ox. ### **t*ils *ttps://*it*u*.*om/w*sm*rio/w*sm*r/issu*s/**** ### Po* * minim*l Rust pro*r*m: ``` *n m*in() { l*t * = st*::*s::Op*nOptions::n

Reasoning

T** vuln*r**ility st*mm** *rom improp*r *il*syst*m s*n**oxin* in W*SI *ir**tory m*ppin*. T** k*y *un*tions *r* in t** W*si *omm*n* **n*l*r w**r*: *. T** pr*p*r*() m*t*o* s*t up *nvironm*nt wit*out prop*rly r*stri*tin* ****ult *ir**tory ****ss *. *uil