CVE-2022-21671: @replit/crosis Potential Exposure Of Tokens To Vulnerability

MODERATE
Advisory Identifier: GHSA-7w54-gp8x-f33m
CVSS 6.5
CWE-200
Published
Advisory Summary

CVE-2022-21671 is a MODERATE (CVSS 6.5) potential exposure of tokens to vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting @replit/crosis libraries in the npm ecosystem. The issue involves potential exposure of tokens to an unauthorized actor. Remediation is available by upgrading affected packages to version 7.3.1.

CVE-2022-21671 at a Glance

CVE Identifier CVE-2022-21671
GHSA Identifier GHSA-7w54-gp8x-f33m
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product @replit/crosis
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2022-21671

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

@replit/crosis fixed: 7.3.1
npm install @replit/crosis@7.3.1
Verify Direct and Transitive Dependencies

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

npm ls @replit/crosis

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-21671, inspect your project dependencies using npm:

npm ls @replit/crosis

Analyze the terminal output to locate any version of @replit/crosis in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.3.1), your application is affected.

Note: The npm ls @replit/crosis command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In @replit/crosis, 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 When using this library as a way to programmatically communicate with Replit in a standalone fashion, if there are multiple failed attempts to contact Replit through a WebSocket, the library will attempt to communicate using a fallback poll-based proxy. The URL of the proxy has changed, so any communication done to the previous URL could potentially reach a server that is outside of Replit's control and the token used to connect to the Repl could be obtained by an attacker, leading to full compromise of that Repl (not of the account). ### Patches This was patched in 7.3.1, by updating the address of the fallback WebSocket polling proxy to the new one. ### Workarounds Specify the new address for the polling host (`gp-v2.replit.com`) in the `ConnectArgs`: ```typescript const connectOptions: ConnectArgs = { // ... pollingHost: 'gp-v2.replit.com', }; client.connect(connectOptions); ``` ### For more information Thanks to https://hackerone.com/orlserg for disclosing this. If you have any questions or comments about this advisory: * Open an issue in [replit/crosis](https://github.com/replit/crosis) * Email us at [security@replit.com](mailto:security@replit.com)

CVE-2022-21671 Affected @replit/crosis Versions

1 component(s)
Fixed Versions:
7.3.1
Product / Package Ecosystem Affected Versions Fixed Version
@replit/crosis
npm
< 7.3.1
7.3.1

References

Frequently Asked Questions

What is CVE-2022-21671?
CVE-2022-21671 is a security vulnerability in @replit/crosis involving Potential exposure of tokens to an Unauthorized Actor under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which @replit/crosis versions are affected?
Affected versions include releases prior to 7.3.1 across affected packages: @replit/crosis.
What version fixes CVE-2022-21671?
Upgrading to 7.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @replit/crosis affected?
Yes, @replit/crosis is affected in releases prior to 7.3.1. Upgrade your dependency to 7.3.1 or later.
What is the CVSS score of CVE-2022-21671?
CVE-2022-21671 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2022-21671?
CVE-2022-21671 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check npm dependencies for CVE-2022-21671?
Run the dependency tree command: 'npm ls @replit/crosis'. 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-7w54-gp8x-f33m",
  "modified" : "2023-07-24T19:32:58Z",
  "published" : "2022-01-12T22:44:47Z",
  "aliases" : [ "CVE-2022-21671" ],
  "summary" : "Potential exposure of tokens to an Unauthorized Actor",
  "details" : "### Impact\n\nWhen using this library as a way to programmatically communicate with Replit in a standalone fashion, if there are multiple failed attempts to contact Replit through a WebSocket, the library will attempt to communicate using a fallback poll-based proxy. The URL of the proxy has changed, so any communication done to the previous URL could potentially reach a server that is outside of Replit's control and the token used to connect to the Repl could be obtained by an attacker, leading to full compromise of that Repl (not of the account).\n\n### Patches\n\nThis was patched in 7.3.1, by updating the address of the fallback WebSocket polling proxy to the new one.\n\n### Workarounds\n\nSpecify the new address for the polling host (`gp-v2.replit.com`) in the `ConnectArgs`:\n\n```typescript\nconst connectOptions: ConnectArgs = {\n  // ...\n  pollingHost: 'gp-v2.replit.com',\n};\nclient.connect(connectOptions);\n```\n\n### For more information\n\nThanks to https://hackerone.com/orlserg for disclosing this.\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [replit/crosis](https://github.com/replit/crosis)\n* Email us at [security@replit.com](mailto:security@replit.com)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@replit/crosis"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/replit/crosis/security/advisories/GHSA-7w54-gp8x-f33m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21671"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/replit/crosis/commit/e44b6a8f5fa28cb2872e3c19bb8a205bb5bfc281"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/replit/crosis"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-10T23:18:10Z",
    "nvd_published_at" : "2022-01-11T15:15:00Z"
  }
}