CVE-2021-32619: Deno's static imports inside dynamically imported modules do not adhere to permission checks
(updated )
Modules that are dynamically imported through import()
or new Worker
might have been able to bypass network and file system permission checks when statically importing other modules. In Deno 1.5.x and 1.6.x only programs dynamically importing (especially transitively) untrusted code are affected. In Deno 1.7.x all programs importing (especially transitively) untrusted code are affected.
In effect an attacker in control of a (possibly remote) module in a programs module graph has been able to, irrespective of permissions:
- initiate GET requests to arbitrary URLs on the internet (including LAN) and possibly read (parts of) the contents of these resources.
- check for existence of arbitrary paths on the file system, and possibly read (parts of) the contents of these files.
In Deno 1.5.x (October 27th, 2020) and Deno 1.6.x (December 8th, 2020) the attacker module had to have been granted permissions to load dynamically through the network / fs read permission. Since Deno 1.7.x (January 19th, 2021) this vulnerability was able to be exploited in a fully sandboxed isolate (without any permissions). This vulnerability was not present in releases prior to 1.5.0.
Arbitrary non-GET requests, control over request headers, or file system writes are not possible through this vulnerability. Users of the deno_core
, deno_runtime
, or other deno_*
crates are not affected. This is a Deno CLI only vulnerability.
We are relatively confident this was not abused in the wild, as by default Deno prints out a green “Download” message when remote imports are downloaded, and this would have caused suspicion if it occurred in the middle of a programs execution. This message can be silenced with the --quiet
flag.
References
Detect and mitigate CVE-2021-32619 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →