CVE-2023-38504: Sails Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-gpw9-fwm8-7rx7
CVSS 7.5
CWE-248
Published
Advisory Summary

CVE-2023-38504 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-248: Uncaught Exception) affecting Sails libraries in the npm ecosystem. The issue involves dos vulnerability for apps with sockets enabled. Remediation is available by upgrading affected packages to version 1.5.7.

CVE-2023-38504 at a Glance

CVE Identifier CVE-2023-38504
GHSA Identifier GHSA-gpw9-fwm8-7rx7
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-248: Uncaught Exception
Affected Product Sails
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-38504

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

sails fixed: 1.5.7
npm install sails@1.5.7
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 sails

How to Check if You Are Affected

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

npm ls sails

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

Note: The npm ls sails 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-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Sails, 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 In Sails apps <=v1.5.6, an attacker can send a virtual request that will cause the node process to crash. ### Patches This behavior was fixed in Sails [v1.5.7](https://github.com/balderdashy/sails/releases/tag/v1.5.7) ### Workarounds Disable the sockets hook and remove the `sails.io.js` client ### References https://github.com/balderdashy/sails/pull/7287 Big thanks to @ThomasRinsma at [Codean](https://www.linkedin.com/company/codeanio/)!

CVE-2023-38504 Affected Sails Versions

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

References

Frequently Asked Questions

What is CVE-2023-38504?
CVE-2023-38504 is a security vulnerability in Sails involving DoS vulnerability for apps with sockets enabled under CWE-248: Uncaught Exception.
Which Sails versions are affected?
Affected versions include releases prior to 1.5.7 across affected packages: sails.
What version fixes CVE-2023-38504?
Upgrading to 1.5.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sails affected?
Yes, sails is affected in releases prior to 1.5.7. Upgrade your dependency to 1.5.7 or later.
What is the CVSS score of CVE-2023-38504?
CVE-2023-38504 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-38504?
CVE-2023-38504 is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check npm dependencies for CVE-2023-38504?
Run the dependency tree command: 'npm ls sails'. 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-gpw9-fwm8-7rx7",
  "modified" : "2023-07-27T21:36:06Z",
  "published" : "2023-07-27T17:13:14Z",
  "aliases" : [ "CVE-2023-38504" ],
  "summary" : "DoS vulnerability for apps with sockets enabled",
  "details" : "### Impact\nIn Sails apps <=v1.5.6, an attacker can send a virtual request that will cause the node process to crash. \n\n### Patches\nThis behavior was fixed in Sails [v1.5.7](https://github.com/balderdashy/sails/releases/tag/v1.5.7)\n\n### Workarounds\nDisable the sockets hook and remove the `sails.io.js` client\n\n### References\nhttps://github.com/balderdashy/sails/pull/7287\n\nBig thanks to @ThomasRinsma at [Codean](https://www.linkedin.com/company/codeanio/)!",
  "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" : "sails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/balderdashy/sails/security/advisories/GHSA-gpw9-fwm8-7rx7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-38504"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/balderdashy/sails/pull/7287"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/balderdashy/sails/commit/4a023dc5095a4b30fdc8535f705ed34cd22d2f7d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/balderdashy/sails"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/balderdashy/sails/releases/tag/v1.5.7"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-27T17:13:14Z",
    "nvd_published_at" : "2023-07-27T19:15:10Z"
  }
}