CVE-2023-45311: Fsevents Code Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-8r6j-v8pm-fqw3
CVSS 9.8
CWE-94
Published
Advisory Summary

CVE-2023-45311 is a CRITICAL (CVSS 9.8) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Fsevents libraries in the npm ecosystem. The issue involves code injection in fsevents. Remediation is available by upgrading affected packages to version 1.2.11.

CVE-2023-45311 at a Glance

CVE Identifier CVE-2023-45311
GHSA Identifier GHSA-8r6j-v8pm-fqw3
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Fsevents
Package Ecosystem npm
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-2023-45311

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

fsevents fixed: 1.2.11
npm install fsevents@1.2.11
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 fsevents

How to Check if You Are Affected

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

npm ls fsevents

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

Note: The npm ls fsevents 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Fsevents, 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

fsevents before 1.2.11 depends on the https://fsevents-binaries.s3-us-west-2.amazonaws.com URL, which might allow an adversary to execute arbitrary code if any JavaScript project (that depends on fsevents) distributes code that was obtained from that URL at a time when it was controlled by an adversary.

CVE-2023-45311 Affected Fsevents Versions

1 component(s)
Fixed Versions:
1.2.11
Product / Package Ecosystem Affected Versions Fixed Version
fsevents
npm
< 1.2.11
1.2.11

References

Frequently Asked Questions

What is CVE-2023-45311?
CVE-2023-45311 is a security vulnerability in Fsevents involving Code injection in fsevents under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Fsevents versions are affected?
Affected versions include releases prior to 1.2.11 across affected packages: fsevents.
What version fixes CVE-2023-45311?
Upgrading to 1.2.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fsevents affected?
Yes, fsevents is affected in releases prior to 1.2.11. Upgrade your dependency to 1.2.11 or later.
What is the CVSS score of CVE-2023-45311?
CVE-2023-45311 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-2023-45311?
CVE-2023-45311 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2023-45311?
Run the dependency tree command: 'npm ls fsevents'. 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-8r6j-v8pm-fqw3",
  "modified" : "2023-10-16T22:21:52Z",
  "published" : "2023-10-06T21:30:49Z",
  "aliases" : [ "CVE-2023-45311" ],
  "summary" : "Code injection in fsevents",
  "details" : "fsevents before 1.2.11 depends on the https://fsevents-binaries.s3-us-west-2.amazonaws.com URL, which might allow an adversary to execute arbitrary code if any JavaScript project (that depends on fsevents) distributes code that was obtained from that URL at a time when it was controlled by an adversary.",
  "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" : "npm",
      "name" : "fsevents"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.11"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.2.10"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-45311"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fsevents/fsevents/commit/909af26846834642c81d19f4148afa3b7557b058"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/atlassian/moo/blob/56ccbdd41b493332bc2cd7a4097a5802594cdb9c/package-lock.json#L1901-L1902"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/atlassian/react-immutable-proptypes/blob/ddb9fa5194b931bf7528eb4f2c0a8c3434f70edd/package-lock.json#L153"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/authr/blob/3f6129d97d06e61033a7f237d84e35e678db490f/ts/package-lock.json#L1512"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/hugo-cloudflare-docs/blob/e0f7cfa195af8ef1bfa51a487be7d34ba298ed06/package-lock.json#L494"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/redux-grim/blob/b652f99f95fb16812336073951adc5c5a93e2c23/package-lock.json#L266-L267"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/serverless-cloudflare-workers/blob/e95e1e9c9770ed9a3d9480c1fa73e64391268354/package-lock.json#L737"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fsevents/fsevents"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fsevents/fsevents/compare/v1.2.10...v1.2.11"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JS-FSEVENTS-5487987"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-09T21:35:16Z",
    "nvd_published_at" : "2023-10-06T21:15:10Z"
  }
}