CVE-2019-13173
Description
fstream before 1.0.12 is vulnerable to Arbitrary File Overwrite. Extracting tarballs containing a hardlink to a file that already exists in the system, and a file that matches the hardlink, will overwrite the system's file with the contents of the extracted file. The fstream.DirWriter() function is vulnerable.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
fstream before 1.0.12 allows arbitrary file overwrite via crafted tarballs using hardlinks to existing system files.
Vulnerability
CVE-2019-13173 is an arbitrary file overwrite vulnerability in the fstream Node.js library, versions before 1.0.12. The root cause lies in the fstream.DirWriter() function's handling of hardlinks when extracting tarballs. If a tarball contains a hardlink pointing to a file that already exists on the system, and also includes another file entry matching that hardlink's target path, the library will overwrite the existing system file with the contents of the extracted file [1][2].
Exploitation
An attacker can exploit this vulnerability by crafting a malicious tarball containing a hardlink to a sensitive system file (e.g., /etc/passwd) and a file entry with the same path. When a user or automated process extracts the tarball using a vulnerable version of fstream, the system file will be overwritten with the attacker-controlled content. No special authentication or network position is required beyond the ability to deliver the tarball to a target system where extraction occurs via fstream [1][2].
Impact
Successful exploitation allows an attacker to overwrite arbitrary files on the system with arbitrary content. This could lead to privilege escalation (by overwriting configuration or executable files), denial of service, or other forms of compromise, depending on which files are overwritten [2].
Mitigation
The vulnerability is fixed in fstream version 1.0.12. The fix, implemented in commit [6a77d2f] [3], checks if the existing file is a hardlink (nlink > 1) when the current type is 'File', and treats it as a type change requiring deletion before writing. Users should update to the patched version immediately. The issue was also addressed in Ubuntu security notice USN-4123-1 [2].
AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
fstreamnpm | < 1.0.12 | 1.0.12 |
Affected products
31- fstream/fstreamdescription
- ghsa-coords30 versionspkg:npm/fstreampkg:rpm/opensuse/nodejs10&distro=openSUSE%20Leap%2015.1pkg:rpm/opensuse/nodejs8&distro=openSUSE%20Leap%2015.0pkg:rpm/opensuse/nodejs8&distro=openSUSE%20Leap%2015.1pkg:rpm/suse/firefox-atk&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/firefox-cairo&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/firefox-gdk-pixbuf&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/firefox-glib2&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/firefox-gtk3&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/firefox-harfbuzz&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/firefox-libffi&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/firefox-libffi-gcc5&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/firefox-pango&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/MozillaFirefox-branding-SLED&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/MozillaFirefox&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/mozilla-nspr&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/mozilla-nss&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4-LTSSpkg:rpm/suse/nodejs10&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2012pkg:rpm/suse/nodejs10&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015pkg:rpm/suse/nodejs10&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP1pkg:rpm/suse/nodejs12&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2012pkg:rpm/suse/nodejs4&distro=SUSE%20Enterprise%20Storage%204pkg:rpm/suse/nodejs4&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2012pkg:rpm/suse/nodejs6&distro=SUSE%20Enterprise%20Storage%204pkg:rpm/suse/nodejs6&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2012pkg:rpm/suse/nodejs6&distro=SUSE%20OpenStack%20Cloud%207pkg:rpm/suse/nodejs6&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/nodejs6&distro=SUSE%20OpenStack%20Cloud%20Crowbar%209pkg:rpm/suse/nodejs8&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015pkg:rpm/suse/nodejs8&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP1
< 1.0.12+ 29 more
- (no CPE)range: < 1.0.12
- (no CPE)range: < 10.16.0-lp151.2.3.1
- (no CPE)range: < 8.15.1-lp151.2.3.1
- (no CPE)range: < 8.15.1-lp151.2.3.1
- (no CPE)range: < 2.26.1-2.8.4
- (no CPE)range: < 1.15.10-2.13.4
- (no CPE)range: < 2.36.11-2.8.4
- (no CPE)range: < 2.54.3-2.14.7
- (no CPE)range: < 3.10.9-2.15.3
- (no CPE)range: < 1.7.5-2.7.4
- (no CPE)range: < 3.2.1.git259-2.3.3
- (no CPE)range: < 5.3.1+r233831-14.1
- (no CPE)range: < 1.40.14-2.7.4
- (no CPE)range: < 68-21.9.8
- (no CPE)range: < 68.2.0-78.51.4
- (no CPE)range: < 4.21-29.6.1
- (no CPE)range: < 3.45-38.9.3
- (no CPE)range: < 10.16.0-1.9.1
- (no CPE)range: < 10.16.0-1.9.1
- (no CPE)range: < 10.16.0-1.9.1
- (no CPE)range: < 12.13.0-1.3.1
- (no CPE)range: < 4.9.1-15.23.1
- (no CPE)range: < 4.9.1-15.23.1
- (no CPE)range: < 6.17.0-11.27.1
- (no CPE)range: < 6.17.0-11.27.1
- (no CPE)range: < 6.17.0-11.27.1
- (no CPE)range: < 6.17.0-11.27.1
- (no CPE)range: < 6.17.0-11.27.1
- (no CPE)range: < 8.15.1-3.17.1
- (no CPE)range: < 8.15.1-3.17.1
Patches
16a77d2fa6e14Clobber a Link if it's in the way of a File
1 file changed · +1 −1
lib/writer.js+1 −1 modified@@ -147,7 +147,7 @@ Writer.prototype._stat = function (current) { // if it's a type change, then we need to clobber or error. // if it's not a type change, then let the impl take care of it. - if (currentType !== self.type) { + if (currentType !== self.type || self.type === 'File' && current.nlink > 1) { return rimraf(self._path, function (er) { if (er) return self.error(er) self._old = null
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- lists.opensuse.org/opensuse-security-announce/2019-08/msg00010.htmlghsavendor-advisoryx_refsource_SUSEWEB
- lists.opensuse.org/opensuse-security-announce/2019-08/msg00052.htmlghsavendor-advisoryx_refsource_SUSEWEB
- github.com/advisories/GHSA-xf7w-r453-m56cghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2019-13173ghsaADVISORY
- usn.ubuntu.com/4123-1/mitrevendor-advisoryx_refsource_UBUNTU
- github.com/npm/fstream/commit/6a77d2fa6e1462693cf8e46f930da96ec1b0bb22ghsax_refsource_MISCWEB
- usn.ubuntu.com/4123-1ghsaWEB
- www.npmjs.com/advisories/886ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.