VYPR
Low severityNVD Advisory· Published Apr 22, 2014· Updated May 6, 2026

CVE-2013-4116

CVE-2013-4116

Description

lib/npm.js in Node Packaged Modules (npm) before 1.3.3 allows local users to overwrite arbitrary files via a symlink attack on temporary files with predictable names that are created when unpacking archives.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
npmnpm
< 1.3.31.3.3

Affected products

1

Patches

1
f4d31693

Put 6 bytes of random in tmp folder name

https://github.com/npm/npmisaacsJul 10, 2013via ghsa
1 file changed · +6 1
  • lib/npm.js+6 1 modified
    @@ -477,9 +477,14 @@ Object.defineProperty(npm, "cache",
       })
     
     var tmpFolder
    +var crypto = require("crypto")
    +var rand = crypto.randomBytes(6)
    +                 .toString("base64")
    +                 .replace(/\//g, '_')
    +                 .replace(/\+/, '-')
     Object.defineProperty(npm, "tmp",
       { get : function () {
    -      if (!tmpFolder) tmpFolder = "npm-" + process.pid
    +      if (!tmpFolder) tmpFolder = "npm-" + process.pid + "-" + rand
           return path.resolve(npm.config.get("tmp"), tmpFolder)
         }
       , enumerable : true
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

11

News mentions

0

No linked articles in our index yet.