Bug 1584400 (CVE-2018-1002204)

Summary: CVE-2018-1002204 nodejs-adm-zip: arbitrary file write vulnerability / arbitrary code execution using a specially crafted zip file
Product: [Other] Security Response Reporter: Laura Pardo <lpardo>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bdettelb, dffrench, drusso, jmadigan, jshepherd, lgriffin, ngough, pwright, rrajasek, security-response-team, tomckay, trepel
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nodejs-adm-zip 0.4.9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-21 20:04:52 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:    
Bug Blocks: 1584402    

Description Laura Pardo 2018-05-30 19:45:50 UTC
A vulnerability has been found in the way developers have implemented the archive extraction of files. An arbitrary file write vulnerability, that can be achieved using a specially crafted zip archive (affects other archives as well, bzip2, tar,xz, war, cpio, 7z), that holds path traversal filenames. So when the filename gets concatenated to the target extraction directory, the final path ends up outside of the target folder. Of course if an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily. This affects multiple libraries that lacks of a high level APIs that provide the archive extraction functionality. 


References:

https://github.com/cthackers/adm-zip/pull/212
https://github.com/cthackers/adm-zip/commit/6f4dfeb9a2166e93207443879988f97d88a37cde

https://github.com/cthackers/adm-zip/pull/215
https://github.com/cthackers/adm-zip/commit/ce59e5a05a0dc1e31ca2f4ae43ae8d50a2f0920a

https://github.com/cthackers/adm-zip/issues/176
https://github.com/cthackers/adm-zip/commit/3f00a03ff55a1e1643b690a67fbe164e9ed7f48a

Comment 5 Tomas Hoger 2018-06-01 09:43:21 UTC
Public now via:

https://snyk.io/vuln/npm:adm-zip:20180415

Comment 6 Jason Shepherd 2021-03-31 20:48:25 UTC
Statement:

While Red Hat Mobile Application Platform (RHMAP) does include the vulnerable library, it does not use the vulnerable methods extract* fixed in the library, [1]. RHMAP upgrade the vulnerable library in a future version.

Red Hat Quay includes adm-zip as a dependency of protractor which is only used at build time. The vulnerable library is not used at runtime meaning this has a low impact on Red Hat Quay.

[1] https://github.com/cthackers/adm-zip/commit/6f4dfeb9a2166e93207443879988f97d88a37cde