Vulnerabilities in pkg:npm/@feathersjs/transport-commons

PACKAGE
Advisory Identifier: GHSA-hhr9-rh25-hvf9
Advisory Summary

CVE-2023-37899 is a HIGH (CVSS 7.5) feathers socket handler allows abusing vulnerability (CWE-754: Improper Check for Unusual or Exceptional Conditions) affecting @feathersjs/socketio libraries in the npm ecosystem. The issue involves feathers socket handler allows abusing implicit tostring. Remediation is available by upgrading affected packages to version 4.5.18, 5.0.8.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@feathersjs/transport-commons

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@feathersjs/transport-commons. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hhr9-rh25-hvf9 CVE-2023-37899 HIGH Feathers socket handler allows abusing implicit toString

CVE-2023-37899 at a Glance

CVE Identifier CVE-2023-37899
GHSA Identifier GHSA-hhr9-rh25-hvf9
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-754: Improper Check for Unusual or Exceptional Conditions
Affected Product @feathersjs/socketio
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/I:N/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 None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2023-37899

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

@feathersjs/socketio fixed: 4.5.18
npm install @feathersjs/socketio@4.5.18
@feathersjs/socketio fixed: 5.0.8
npm install @feathersjs/socketio@5.0.8
@feathersjs/transport-commons fixed: 4.5.18
npm install @feathersjs/transport-commons@4.5.18
@feathersjs/transport-commons fixed: 5.0.8
npm install @feathersjs/transport-commons@5.0.8
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 @feathersjs/socketio

How to Check if You Are Affected

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

npm ls @feathersjs/socketio

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

Note: The npm ls @feathersjs/socketio 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-754: Improper Check for Unusual or Exceptional Conditions, where the product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product. In @feathersjs/socketio, 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 Feathers socket handler did not catch invalid string conversion errors like: ```ts const message = `${{ toString: '' }}` ``` Causing the NodeJS process to crash when sending an unexpected Socket.io message like ```ts socket.emit('find', { toString: '' }) ``` ### Patches A fix has been released in - `v5.0.8` via #3241 - `v4.5.18` via #3242 ### Workarounds Since it is in the core Socket handling code upgrading to the latest version is necessary. ### References - [v5.0.8 Changelog](https://github.com/feathersjs/feathers/blob/dove/CHANGELOG.md#508-2023-07-19) - [v4.5.18 Changelog](https://github.com/feathersjs/feathers/blob/crow/CHANGELOG.md#4518-2023-07-19)

CVE-2023-37899 Affected @feathersjs/socketio Versions

4 component(s)
Fixed Versions:
4.5.185.0.8
Product / Package Ecosystem Affected Versions Fixed Version
@feathersjs/socketio
npm
< 4.5.18
4.5.18
@feathersjs/socketio
npm
≥ 5.0.0
< 5.0.8
5.0.8
@feathersjs/transport-commons
npm
< 4.5.18
4.5.18
@feathersjs/transport-commons
npm
≥ 5.0.0
< 5.0.8
5.0.8

References

Frequently Asked Questions

What is CVE-2023-37899?
CVE-2023-37899 is a security vulnerability in @feathersjs/socketio involving Feathers socket handler allows abusing implicit toString under CWE-754: Improper Check for Unusual or Exceptional Conditions.
Which @feathersjs/socketio versions are affected?
Affected versions include releases prior to 4.5.18, 5.0.8 across affected packages: @feathersjs/socketio, @feathersjs/transport-commons.
What version fixes CVE-2023-37899?
Upgrading to 4.5.18, 5.0.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @feathersjs/socketio affected?
Yes, @feathersjs/socketio is affected in releases prior to 4.5.18, 5.0.8. Upgrade your dependency to 4.5.18, 5.0.8 or later.
Is @feathersjs/transport-commons affected?
Yes, @feathersjs/transport-commons is affected in releases prior to 4.5.18, 5.0.8. Upgrade your dependency to 4.5.18, 5.0.8 or later.
What is the CVSS score of CVE-2023-37899?
CVE-2023-37899 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-37899?
CVE-2023-37899 is classified under CWE-754: Improper Check for Unusual or Exceptional Conditions (The product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product.).
How can I check npm dependencies for CVE-2023-37899?
Run the dependency tree command: 'npm ls @feathersjs/socketio'. 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-hhr9-rh25-hvf9",
  "modified" : "2023-07-20T14:54:30Z",
  "published" : "2023-07-20T14:54:30Z",
  "aliases" : [ "CVE-2023-37899" ],
  "summary" : "Feathers socket handler allows abusing implicit toString",
  "details" : "### Impact\n\nFeathers socket handler did not catch invalid string conversion errors like:\n\n```ts\nconst message = `${{ toString: '' }}`\n```\n\nCausing the NodeJS process to crash when sending an unexpected Socket.io message like\n\n```ts\nsocket.emit('find', { toString: '' })\n```\n\n### Patches\n\nA fix has been released in\n\n- `v5.0.8` via #3241\n- `v4.5.18` via #3242\n\n### Workarounds\n\nSince it is in the core Socket handling code upgrading to the latest version is necessary.\n### References\n\n- [v5.0.8 Changelog](https://github.com/feathersjs/feathers/blob/dove/CHANGELOG.md#508-2023-07-19)\n- [v4.5.18 Changelog](https://github.com/feathersjs/feathers/blob/crow/CHANGELOG.md#4518-2023-07-19)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@feathersjs/socketio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.18"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.5.17"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@feathersjs/socketio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.0.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.0.7"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@feathersjs/transport-commons"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.18"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.5.17"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@feathersjs/transport-commons"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.0.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.0.7"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/feathersjs/feathers/security/advisories/GHSA-hhr9-rh25-hvf9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-37899"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/feathersjs/feathers/pull/3241"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/feathersjs/feathers/pull/3242"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/feathersjs/feathers/commit/0b9a6b19b12ad05934e4c8bd9917448ed39d1ed8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/feathersjs/feathers/commit/c397ab3a0cd184044ae4f73540549b30a396821c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/feathersjs/feathers"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/feathersjs/feathers/blob/crow/CHANGELOG.md#4518-2023-07-19"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/feathersjs/feathers/blob/dove/CHANGELOG.md#508-2023-07-19"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-754" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-20T14:54:30Z",
    "nvd_published_at" : "2023-07-19T20:15:10Z"
  }
}