Vulnerabilities in pkg:npm/sync-exec

PACKAGE
Advisory Identifier: GHSA-38h8-x697-gh8q
Advisory Summary

CVE-2017-16024 is a MODERATE (CVSS 6.5) tmp files readable by other vulnerability (CWE-377: Insecure Temporary File) affecting Sync exec libraries in the npm ecosystem. The issue involves tmp files readable by other users in sync-exec. Remediation is available in the latest vendor maintenance releases.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/sync-exec

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/sync-exec. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-38h8-x697-gh8q CVE-2017-16024 MODERATE Tmp files readable by other users in sync-exec

CVE-2017-16024 at a Glance

CVE Identifier CVE-2017-16024
GHSA Identifier GHSA-38h8-x697-gh8q
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-377: Insecure Temporary File
Affected Product Sync exec
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).

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

How to Fix CVE-2017-16024

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

sync-exec fixed: Latest secure release
npm install sync-exec@Latest secure release
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 sync-exec

How to Check if You Are Affected

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

npm ls sync-exec

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

Note: The npm ls sync-exec 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-377: Insecure Temporary File, where creating and using insecure temporary files can leave application and system data vulnerable to attack. In Sync exec, 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

Affected versions of `sync-exec` use files located in `/tmp/` to buffer command results before returning values. As `/tmp/` is almost always set with world readable permissions, this may allow low privilege users on the system to read the results of commands run via `sync-exec` under a higher privilege user. ## Recommendation There is currently no direct patch for `sync-exec`, as the `child_process.execSync` function provided in Node.js v0.12.0 and later provides the same functionality natively. The best mitigation currently is to update to Node.js v0.12.0 or later, and migrate all uses of `sync-exec` to `child_process.execSync()`.

CVE-2017-16024 Affected Sync exec Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
sync-exec
npm
≤ 0.6.2

References

Frequently Asked Questions

What is CVE-2017-16024?
CVE-2017-16024 is a security vulnerability in Sync exec involving Tmp files readable by other users in sync-exec under CWE-377: Insecure Temporary File.
Which Sync exec versions are affected?
Affected versions include releases prior to current release patches across affected packages: sync-exec.
What version fixes CVE-2017-16024?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is sync-exec affected?
Yes, sync-exec is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2017-16024?
CVE-2017-16024 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2017-16024?
CVE-2017-16024 is classified under CWE-377: Insecure Temporary File (Creating and using insecure temporary files can leave application and system data vulnerable to attack.).
How can I check npm dependencies for CVE-2017-16024?
Run the dependency tree command: 'npm ls sync-exec'. 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-38h8-x697-gh8q",
  "modified" : "2023-09-07T20:13:49Z",
  "published" : "2018-11-09T17:45:30Z",
  "aliases" : [ "CVE-2017-16024" ],
  "summary" : "Tmp files readable by other users in sync-exec",
  "details" : "Affected versions of `sync-exec` use files located in `/tmp/` to buffer command results before returning values. As `/tmp/` is almost always set with world readable permissions, this may allow low privilege users on the system to read the results of commands run via `sync-exec` under a higher privilege user.\n\n\n## Recommendation\n\nThere is currently no direct patch for `sync-exec`, as the `child_process.execSync` function provided in Node.js v0.12.0 and later provides the same functionality natively. \n\nThe best mitigation currently is to update to Node.js v0.12.0 or later, and migrate all uses of `sync-exec` to `child_process.execSync()`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "sync-exec"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.6.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-16024"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gvarsanyi/sync-exec/issues/17"
  }, {
    "type" : "WEB",
    "url" : "https://cwe.mitre.org/data/definitions/377.html"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-38h8-x697-gh8q"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/310"
  }, {
    "type" : "WEB",
    "url" : "https://www.owasp.org/index.php/Insecure_Temporary_File"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-377" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:54:36Z",
    "nvd_published_at" : null
  }
}