Bug 1702338 (CVE-2018-20834)

Summary: CVE-2018-20834 nodejs-tar: Arbitrary file overwrites when extracting tarballs containing a hard-link
Product: [Other] Security Response Reporter: Laura Pardo <lpardo>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: ahardin, bleanhar, bmontgom, cbyrne, ccoleman, cmacedo, dedgar, dffrench, drusso, eparis, hhorak, jburrell, jcantril, jgoulding, jmadigan, jokerman, jorton, jshepherd, mchappel, ngough, nodejs-sig, nstielau, periklis, pwright, rschiron, sponnaga, tchollingsworth, thrcka, tjay, trepel, yozone, zsvetlik
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nodejs-tar 4.4.2 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in nodejs-tar in versions prior to 4.4.2. An arbitrary file overwrite can occur when extracting tarballs containing a hard-link to a file that already exists in the system. Further, a file that matches the hard-link may overwrite the system's files with the contents of the extracted file. The highest threat from the vulnerability is to data confidentiality and integrity as well as system availability.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-22 15:07:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1702339, 1702340, 1710734, 1710735    
Bug Blocks: 1702341    

Description Laura Pardo 2019-04-23 14:19:06 UTC
A vulnerability was found in nodejs-tar before version 4.4.2. An Arbitrary File Overwrite when extracting tarballs containing a hard-link to a file that already exists in the system, and a file that matches the hard-link may overwrite system's files with the contents of the extracted file.


References:
https://hackerone.com/reports/344595

Upstream Patch:
https://github.com/npm/node-tar/commit/b0c58433c22f5e7fe8b1c76373f27e3f81dcd4c8

Comment 1 Laura Pardo 2019-04-23 14:19:32 UTC
Created nodejs-tar tracking bugs for this issue:

Affects: epel-all [bug 1702339]
Affects: fedora-all [bug 1702340]

Comment 2 Riccardo Schirone 2019-04-30 15:12:48 UTC
Raised the CVSS score to CIA:HHH as the specially crafted tar file could overwrite files that would allow an attacker to execute code on the victim's machine as his user.

Comment 9 Riccardo Schirone 2019-05-16 07:56:10 UTC
Red Hat Software Collection Node.js 10 (rh-nodejs10-nodejs) is not affected by this flaw because it already contains the patched code.

Comment 12 errata-xmlrpc 2019-07-22 13:37:57 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS

Via RHSA-2019:1821 https://access.redhat.com/errata/RHSA-2019:1821

Comment 13 Product Security DevOps Team 2019-07-22 15:07:09 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2018-20834

Comment 14 Eric Christensen 2020-04-29 15:06:56 UTC
External References:

https://hackerone.com/reports/344595