CVE-2021-32619: Deno Deno's Static Imports Inside Dynamically Vulnerability

CRITICAL
Advisory Identifier: GHSA-xpwj-7v8q-mcgj
CVSS 9.8
CWE-285 CWE-863
Published
Advisory Summary

CVE-2021-32619 is a CRITICAL (CVSS 9.8) deno's static imports inside dynamically vulnerability (CWE-285: Improper Authorization) affecting Deno libraries in the crates.io ecosystem. The issue involves deno's static imports inside dynamically imported modules do not adhere to permission checks. Remediation is available by upgrading affected packages to version 1.10.2.

CVE-2021-32619 at a Glance

CVE Identifier CVE-2021-32619
GHSA Identifier GHSA-xpwj-7v8q-mcgj
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-285: Improper Authorization
Affected Product Deno
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2021-32619

To remediate this vulnerability, upgrade all affected Deno dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

deno fixed: 1.10.2
Upgrade deno to 1.10.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for deno

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-32619, inspect your project dependencies for Deno:

inspect dependencies for deno

Analyze the terminal output to locate any version of Deno in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.2), 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-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Deno, 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

### Impact 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**: 1. initiate GET requests to arbitrary URLs on the internet (including LAN) and possibly read (parts of) the contents of these resources. 2. 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. ### Patches The vulnerability has been patched in Deno release 1.10.2. You can upgrade to the latest Deno version by running the `deno upgrade` command. The release is available through all official download channels. ### Workarounds There is no workaround for this issue. ### For more information If you have any questions or comments about this advisory: * Open an issue on [the issue tracker](https://github.com/denoland/deno) * Discuss on [Discord](https://discord.gg/deno)

CVE-2021-32619 Affected Deno Versions

1 component(s)
Fixed Versions:
1.10.2
Product / Package Ecosystem Affected Versions Fixed Version
deno
crates.io
≥ 1.5.0
< 1.10.2
1.10.2

References

Frequently Asked Questions

What is CVE-2021-32619?
CVE-2021-32619 is a security vulnerability in Deno involving Deno's static imports inside dynamically imported modules do not adhere to permission checks under CWE-285: Improper Authorization.
Which Deno versions are affected?
Affected versions include releases prior to 1.10.2 across affected packages: deno.
What version fixes CVE-2021-32619?
Upgrading to 1.10.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is deno affected?
Yes, deno is affected in releases prior to 1.10.2. Upgrade your dependency to 1.10.2 or later.
What is the CVSS score of CVE-2021-32619?
CVE-2021-32619 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-32619?
CVE-2021-32619 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check crates.io dependencies for CVE-2021-32619?
Run the dependency tree command: 'inspect dependencies for deno'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xpwj-7v8q-mcgj",
  "modified" : "2022-08-11T16:54:03Z",
  "published" : "2021-09-23T23:18:03Z",
  "aliases" : [ "CVE-2021-32619" ],
  "summary" : "Deno's static imports inside dynamically imported modules do not adhere to permission checks",
  "details" : "### Impact\n\nModules 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.\n\nIn effect an attacker in control of a (possibly remote) module in a programs module graph has been able to, **irrespective of permissions**:\n1. initiate GET requests to arbitrary URLs on the internet (including LAN) and possibly read (parts of) the contents of these resources.\n2. check for existence of arbitrary paths on the file system, and possibly read (parts of) the contents of these files.\n\nIn 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.\n\nArbitrary 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.\n\nWe 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.  \n\n### Patches\n\nThe vulnerability has been patched in Deno release 1.10.2. You can upgrade to the latest Deno version by running the `deno upgrade` command. The release is available through all official download channels. \n\n### Workarounds\n\nThere is no workaround for this issue.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue on [the issue tracker](https://github.com/denoland/deno)\n* Discuss on [Discord](https://discord.gg/deno)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "deno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0"
      }, {
        "fixed" : "1.10.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.10.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/denoland/deno/security/advisories/GHSA-xpwj-7v8q-mcgj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32619"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/denoland/deno"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285", "CWE-863" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-23T21:13:15Z",
    "nvd_published_at" : "2021-05-28T21:15:00Z"
  }
}