CVE-2013-4116: Npm Local Privilege Escalation Vulnerability

LOW
Advisory Identifier: GHSA-v3jv-wrf4-5845
CWE-59
Published
Advisory Summary

CVE-2013-4116 is a LOW local privilege escalation vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Npm libraries in the npm ecosystem. The issue involves local privilege escalation in npm. Remediation is available by upgrading affected packages to version 1.3.3.

CVE-2013-4116 at a Glance

CVE Identifier CVE-2013-4116
GHSA Identifier GHSA-v3jv-wrf4-5845
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
Affected Product Npm
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2013-4116

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

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

How to Check if You Are Affected

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

npm ls npm

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

Note: The npm ls npm 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-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In Npm, 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 `npm` use predictable temporary file names during archive unpacking. If an attacker can create a symbolic link at the location of one of these temporary file names, the attacker can arbitrarily write to any file that the user which owns the `npm` process has permission to write to, potentially resulting in local privilege escalation. ## Recommendation Update to version 1.3.3 or later.

CVE-2013-4116 Affected Npm Versions

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

References

Frequently Asked Questions

What is CVE-2013-4116?
CVE-2013-4116 is a security vulnerability in Npm involving Local Privilege Escalation in npm under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which Npm versions are affected?
Affected versions include releases prior to 1.3.3 across affected packages: npm.
What version fixes CVE-2013-4116?
Upgrading to 1.3.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is npm affected?
Yes, npm is affected in releases prior to 1.3.3. Upgrade your dependency to 1.3.3 or later.
What CWE is associated with CVE-2013-4116?
CVE-2013-4116 is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.).
How can I check npm dependencies for CVE-2013-4116?
Run the dependency tree command: 'npm ls npm'. 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-v3jv-wrf4-5845",
  "modified" : "2021-09-23T21:38:18Z",
  "published" : "2020-09-01T16:03:34Z",
  "aliases" : [ "CVE-2013-4116" ],
  "summary" : "Local Privilege Escalation in npm",
  "details" : "Affected versions of `npm` use predictable temporary file names during archive unpacking. If an attacker can create a symbolic link at the location of one of these temporary file names, the attacker can arbitrarily write to any file that the user which owns the `npm` process has permission to write to, potentially resulting in local privilege escalation.\n\n\n\n## Recommendation\n\nUpdate to version 1.3.3 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "npm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-4116"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/npm/npm/issues/3635"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/npm/npm/commit/f4d31693"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715325"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=983917"
  }, {
    "type" : "WEB",
    "url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/87141"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/npm/npm"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/152"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2013/07/10/17"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2013/07/11/9"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/61083"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-59" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:12:39Z",
    "nvd_published_at" : null
  }
}