CVE-2023-51661: Wasmer cli Remote Code Execution Vulnerability
HIGHCVE-2023-51661 is a HIGH (CVSS 8.4) remote code execution vulnerability (CWE-284: Improper Access Control) affecting Wasmer cli libraries in the crates.io ecosystem. The issue involves wasmer filesystem sandbox not enforced. Remediation is available by upgrading affected packages to version 4.2.4.
CVE-2023-51661 at a Glance
Security Impact
CVSS: 8.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2023-51661
To remediate this vulnerability, upgrade all affected Wasmer cli dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade wasmer-cli to 4.2.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for wasmer-cli
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-51661, inspect your project dependencies for Wasmer cli:
inspect dependencies for wasmer-cli
Analyze the terminal output to locate any version of Wasmer cli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Wasmer cli, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-51661 Affected Wasmer cli Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
wasmer-cli
|
crates.io |
≥ 3.0.0
< 4.2.4
|
4.2.4
|
References
Frequently Asked Questions
What is CVE-2023-51661?
Which Wasmer cli versions are affected?
What version fixes CVE-2023-51661?
Is wasmer-cli affected?
What is the CVSS score of CVE-2023-51661?
What CWE is associated with CVE-2023-51661?
How can I check crates.io dependencies for CVE-2023-51661?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4mq4-7rw3-vm5j",
"modified" : "2024-01-03T16:44:36Z",
"published" : "2023-12-13T13:32:38Z",
"aliases" : [ "CVE-2023-51661" ],
"summary" : "Wasmer filesystem sandbox not enforced",
"details" : "### Summary\nAs of Wasmer version v4.2.3, Wasm programs can access the filesystem outside of the sandbox.\n\n### Details\nhttps://github.com/wasmerio/wasmer/issues/4267\n\n### PoC\nA minimal Rust program:\n\n```\nfn main() {\n let f = std::fs::OpenOptions::new()\n .write(true)\n .create_new(true)\n .open(\"abc\")\n .unwrap();\n}\n```\n\nThis should be compiled with `cargo build --target wasm32-wasi`. The compiled program, when run with wasmer WITHOUT `--dir`, can still create a file in the working directory.\n\n### Impact\nService providers running untrusted Wasm code on Wasmer can unexpectedly expose the host filesystem.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "wasmer-cli"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "4.2.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/wasmerio/wasmer/security/advisories/GHSA-4mq4-7rw3-vm5j"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-51661"
}, {
"type" : "WEB",
"url" : "https://github.com/wasmerio/wasmer/issues/4267"
}, {
"type" : "WEB",
"url" : "https://github.com/wasmerio/wasmer/commit/4d63febf9d8b257b0531963b85df48d45d0dbf3c"
}, {
"type" : "WEB",
"url" : "https://github.com/wasmerio/wasmer/commit/e3923612c23123025c26f982d390e34df7df030f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/wasmerio/wasmer"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-284" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-12-13T13:32:38Z",
"nvd_published_at" : "2023-12-22T15:15:08Z"
}
}