CVE-2023-22499: Deno Deno Is Vulnerable To Race Vulnerability

HIGH
Advisory Identifier: GHSA-mc52-jpm2-cqh6
CVSS 8.8
CWE-362
Published
Advisory Summary

CVE-2023-22499 is a HIGH (CVSS 8.8) deno is vulnerable to race vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Deno libraries in the crates.io ecosystem. The issue involves deno is vulnerable to race condition via interactive permission prompt spoofing. Remediation is available by upgrading affected packages to version 1.29.3.

CVE-2023-22499 at a Glance

CVE Identifier CVE-2023-22499
GHSA Identifier GHSA-mc52-jpm2-cqh6
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Deno
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 8.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:R/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 Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-22499

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.29.3
Upgrade deno to 1.29.3
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-2023-22499, 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.29.3), 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-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. 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 Multi-threaded programs were able to spoof interactive permission prompt by rewriting the prompt to suggest that program is waiting on user confirmation to unrelated action. A malicious program could clear the terminal screen after permission prompt was shown and write a generic message like so: ``` // Expected prompt ⚠️ ┌ Deno requests read access to "./log.txt". ├ Requested by `Deno.open()` API ├ Run again with --allow-read to bypass this prompt. └ Allow? [y/n] (y = yes, allow; n = no, deny) > // Prompt that users would see Do you want to continue? ``` This situation impacts users who use Web Worker API and relied on interactive permission prompt. The reproduction is very timing sensitive and can’t be reliably reproduced on every try. This problem can not be exploited on systems that do not attach an interactive prompt (for example headless servers). ### Patches The problem has been fixed in Deno v1.29.3; it is recommended all users update to this version. ### Workarounds Run with `--no-prompt` flag to disable interactive permission prompts.

CVE-2023-22499 Affected Deno Versions

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

References

Frequently Asked Questions

What is CVE-2023-22499?
CVE-2023-22499 is a security vulnerability in Deno involving Deno is vulnerable to race condition via interactive permission prompt spoofing under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Deno versions are affected?
Affected versions include releases prior to 1.29.3 across affected packages: deno.
What version fixes CVE-2023-22499?
Upgrading to 1.29.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is deno affected?
Yes, deno is affected in releases prior to 1.29.3. Upgrade your dependency to 1.29.3 or later.
What is the CVSS score of CVE-2023-22499?
CVE-2023-22499 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-22499?
CVE-2023-22499 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check crates.io dependencies for CVE-2023-22499?
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-mc52-jpm2-cqh6",
  "modified" : "2023-04-03T19:15:49Z",
  "published" : "2023-01-20T16:56:40Z",
  "aliases" : [ "CVE-2023-22499" ],
  "summary" : "Deno is vulnerable to race condition via interactive permission prompt spoofing",
  "details" : "### Impact\n\nMulti-threaded programs were able to spoof interactive permission prompt by rewriting the prompt to suggest that program is waiting on user confirmation to unrelated action. \n\nA malicious program could clear the terminal screen after permission prompt was shown and write a generic message like so:\n```\n// Expected prompt\n⚠️  ┌ Deno requests read access to \"./log.txt\".\n   ├ Requested by `Deno.open()` API\n   ├ Run again with --allow-read to bypass this prompt.\n   └ Allow? [y/n] (y = yes, allow; n = no, deny) >\n\n// Prompt that users would see\nDo you want to continue?\n```\n\nThis situation impacts users who use Web Worker API and relied on interactive permission prompt. The reproduction is very timing sensitive and can’t be reliably reproduced on every try.\n\nThis problem can not be exploited on systems that do not attach an interactive prompt (for example headless servers). \n\n### Patches\n\nThe problem has been fixed in Deno v1.29.3; it is recommended all users update to this version.\n\n### Workarounds\n\nRun with `--no-prompt` flag to disable interactive permission prompts.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "deno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.9.0"
      }, {
        "fixed" : "1.29.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/denoland/deno/security/advisories/GHSA-mc52-jpm2-cqh6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-22499"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/denoland/deno/pull/17392"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/denoland/deno"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-20T16:56:40Z",
    "nvd_published_at" : "2023-01-17T21:15:00Z"
  }
}