{
  "schema_version": "1.4.0",
  "id": "GHSA-q4v7-4rhw-9hqm",
  "modified": "2021-06-23T15:41:17Z",
  "published": "2018-07-18T18:27:56Z",
  "aliases": [
    "CVE-2017-5941"
  ],
  "summary": "Code Execution through IIFE in node-serialize",
  "details": "Affected versions of `node-serialize` can be abused to execute arbitrary code via an [immediately invoked function expression](https://en.wikipedia.org/wiki/Immediately-invoked_function_expression) (IIFE) if untrusted user input is passed into `unserialize()`.\n\n\n## Recommendation\n\nThere is no direct patch for this issue. The package author has reviewed this advisory, and provided the following recommendation:\n\n```\nTo avoid the security issues, at least one of the following methods should be taken:\n\n1. Make sure to send serialized strings internally, isolating them from potential hackers. For example, only sending the strings from backend to fronend and always using HTTPS instead of HTTP.\n\n2. Introduce public-key cryptosystems (e.g. RSA) to ensure the strings not being tampered with.\n```",
  "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": "node-serialize"
      },
      "ranges": [
        {
          "type": "ECOSYSTEM",
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "0.0.4"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2017-5941"
    },
    {
      "type": "WEB",
      "url": "https://github.com/luin/serialize/issues/4"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-q4v7-4rhw-9hqm"
    },
    {
      "type": "WEB",
      "url": "https://opsecx.com/index.php/2017/02/08/exploiting-node-js-deserialization-bug-for-remote-code-execution"
    },
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/311"
    },
    {
      "type": "WEB",
      "url": "http://packetstormsecurity.com/files/161356/Node.JS-Remote-Code-Execution.html"
    },
    {
      "type": "WEB",
      "url": "http://packetstormsecurity.com/files/163222/Node.JS-Remote-Code-Execution.html"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/96225"
    }
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-502"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:51:00Z",
    "nvd_published_at": "2017-02-09T19:59:00Z"
  }
}