{"id":"CVE-2026-47261","state":"PUBLISHED","title":"Wasmtime: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction","description":"Wasmtime is a runtime for WebAssembly. In versions prior to 24.0.9, 36.0.10, and 44.0.2, when a filesystem preopen is given DirPerms::all() and FilePerms::READ without FilePerms::WRITE, this access control mechanism can be bypassed via the wasip2 descriptor.open-at or wasip1 path_open interfaces by opening a file with only the OpenFlags::TRUNCATE oflag. The root cause is that the clause handling OpenFlags::TRUNCATE in crates/wasi/src/filesystem.rs (Dir::open_at, lines 967–969) did not set open_mode |= OpenMode::WRITE;, which is later used for the access control check against FilePerms to determine whether opening the file is permitted; the single-line fix adds that missing assignment, after which the affected calls correctly fail with error-code.not-permitted and ERRNO_PERM respectively. Only wasmtime-wasi embeddings that combine DirPerms::MUTATE with FilePerms::READ are affected by this bug. In particular, the Wasmtime project's wasmtime-cli's use of wasmtime-wasi is not affected, because it always sets FilePerms::all() for all preopens. This issue has been fixed in versions 24.0.9, 36.0.10 and44.0.2.","publishedAt":"2026-06-15T19:47:40.366Z","updatedAt":"2026-06-16T12:46:04.260Z","severity":{"score":7.5,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","source":"GitHub_M"},"assigner":"GitHub_M","products":["bytecodealliance wasmtime"],"affected":[{"vendor":"bytecodealliance","product":"wasmtime","versions":[{"version":">= 37.0.0, < 44.0.2","status":"affected"},{"version":">= 25.0.0, < 36.0.10","status":"affected"},{"version":"< 24.0.9","status":"affected"}]}],"references":["https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-2r75-cxrj-cmph","https://github.com/bytecodealliance/wasmtime/releases/tag/v24.0.9","https://github.com/bytecodealliance/wasmtime/releases/tag/v36.0.10","https://github.com/bytecodealliance/wasmtime/releases/tag/v44.0.2","https://github.com/bytecodealliance/wasmtime/releases/tag/v45.0.0"],"weaknesses":["CWE-284"],"ingestedAt":"2026-10-29T20:12:07.131Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/47xxx/CVE-2026-47261.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-47261","state":"PUBLISHED","datePublished":"2026-06-15T19:47:40.366Z","dateUpdated":"2026-06-16T12:46:04.260Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-05-18T23:03:37.229Z"},"containers":{"cna":{"title":"Wasmtime: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction","descriptions":[{"lang":"en","value":"Wasmtime is a runtime for WebAssembly. In versions prior to 24.0.9, 36.0.10, and 44.0.2, when a filesystem preopen is given DirPerms::all() and FilePerms::READ without FilePerms::WRITE, this access control mechanism can be bypassed via the wasip2 descriptor.open-at or wasip1 path_open interfaces by opening a file with only the OpenFlags::TRUNCATE oflag. The root cause is that the clause handling OpenFlags::TRUNCATE in crates/wasi/src/filesystem.rs (Dir::open_at, lines 967–969) did not set open_mode |= OpenMode::WRITE;, which is later used for the access control check against FilePerms to determine whether opening the file is permitted; the single-line fix adds that missing assignment, after which the affected calls correctly fail with error-code.not-permitted and ERRNO_PERM respectively. Only wasmtime-wasi embeddings that combine DirPerms::MUTATE with FilePerms::READ are affected by this bug. In particular, the Wasmtime project's wasmtime-cli's use of wasmtime-wasi is not affected, because it always sets FilePerms::all() for all preopens. This issue has been fixed in versions 24.0.9, 36.0.10 and44.0.2."}],"affected":[{"vendor":"bytecodealliance","product":"wasmtime","versions":[{"version":">= 37.0.0, < 44.0.2","status":"affected"},{"version":">= 25.0.0, < 36.0.10","status":"affected"},{"version":"< 24.0.9","status":"affected"}]}],"references":[{"url":"https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-2r75-cxrj-cmph","name":"https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-2r75-cxrj-cmph","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/bytecodealliance/wasmtime/releases/tag/v24.0.9","name":"https://github.com/bytecodealliance/wasmtime/releases/tag/v24.0.9","tags":["x_refsource_MISC"]},{"url":"https://github.com/bytecodealliance/wasmtime/releases/tag/v36.0.10","name":"https://github.com/bytecodealliance/wasmtime/releases/tag/v36.0.10","tags":["x_refsource_MISC"]},{"url":"https://github.com/bytecodealliance/wasmtime/releases/tag/v44.0.2","name":"https://github.com/bytecodealliance/wasmtime/releases/tag/v44.0.2","tags":["x_refsource_MISC"]},{"url":"https://github.com/bytecodealliance/wasmtime/releases/tag/v45.0.0","name":"https://github.com/bytecodealliance/wasmtime/releases/tag/v45.0.0","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"NONE","baseScore":7.5,"baseSeverity":"HIGH","confidentialityImpact":"NONE","integrityImpact":"HIGH","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-284","lang":"en","description":"CWE-284: Improper Access Control","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-06-15T19:47:40.366Z"},"source":{"advisory":"GHSA-2r75-cxrj-cmph","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-06-16T12:45:55.792446Z","id":"CVE-2026-47261","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-06-16T12:46:04.260Z"}}]}}}