CVE-2022-1650: Eventsource Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-6h5x-7c5m-7cr7
CVSS 9.3
CWE-212 CWE-200
Published
Advisory Summary

CVE-2022-1650 is a CRITICAL (CVSS 9.3) remote code execution vulnerability (CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer) affecting Eventsource libraries in the npm ecosystem. The issue involves exposure of sensitive information in eventsource. Remediation is available by upgrading affected packages to version 1.1.1, 2.0.2.

CVE-2022-1650 at a Glance

CVE Identifier CVE-2022-1650
GHSA Identifier GHSA-6h5x-7c5m-7cr7
Severity CRITICAL
CVSS v3.1 Base Score 9.3
CWE Classification CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer
Affected Product Eventsource
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.3

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:C/C:H/I:H/A:N).

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

How to Fix CVE-2022-1650

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

eventsource fixed: 1.1.1
npm install eventsource@1.1.1
eventsource fixed: 2.0.2
npm install eventsource@2.0.2
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 eventsource

How to Check if You Are Affected

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

npm ls eventsource

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

Note: The npm ls eventsource 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-212: Improper Removal of Sensitive Information Before Storage or Transfer, where the product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors. In Eventsource, 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

When fetching an url with a link to an external site (Redirect), the users Cookies & Autorisation headers are leaked to the third party application. According to the same-origin-policy, the header should be "sanitized."

CVE-2022-1650 Affected Eventsource Versions

2 component(s)
Fixed Versions:
1.1.12.0.2
Product / Package Ecosystem Affected Versions Fixed Version
eventsource
npm
< 1.1.1
1.1.1
eventsource
npm
≥ 2.0.0
< 2.0.2
2.0.2

References

Frequently Asked Questions

What is CVE-2022-1650?
CVE-2022-1650 is a security vulnerability in Eventsource involving Exposure of Sensitive Information in eventsource under CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer.
Which Eventsource versions are affected?
Affected versions include releases prior to 1.1.1, 2.0.2 across affected packages: eventsource.
What version fixes CVE-2022-1650?
Upgrading to 1.1.1, 2.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is eventsource affected?
Yes, eventsource is affected in releases prior to 1.1.1, 2.0.2. Upgrade your dependency to 1.1.1, 2.0.2 or later.
What is the CVSS score of CVE-2022-1650?
CVE-2022-1650 has a CVSS v3.1 base score of 9.3 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2022-1650?
CVE-2022-1650 is classified under CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer (The product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors.).
How can I check npm dependencies for CVE-2022-1650?
Run the dependency tree command: 'npm ls eventsource'. 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-6h5x-7c5m-7cr7",
  "modified" : "2022-05-25T19:28:43Z",
  "published" : "2022-05-13T00:01:12Z",
  "aliases" : [ "CVE-2022-1650" ],
  "summary" : "Exposure of Sensitive Information in eventsource",
  "details" : "When fetching an url with a link to an external site (Redirect), the users Cookies & Autorisation headers are leaked to the third party application. According to the same-origin-policy, the header should be \"sanitized.\"",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "eventsource"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "eventsource"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-1650"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/EventSource/eventsource/pull/273#issuecomment-1127624508"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/EventSource/eventsource/commit/f9f6416567bff62c1af2f4314be51d9870e94bc2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eventsource/eventsource/commit/10ee0c4881a6ba2fe65ec18ed195ac35889583c4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/eventsource/eventsource"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/dc9e467f-be5d-4945-867d-1044d27e9b8e"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2022/12/msg00021.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-212" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-05-25T19:27:47Z",
    "nvd_published_at" : "2022-05-12T11:15:00Z"
  }
}