Bug 1851875 (CVE-2019-15608)

Summary: CVE-2019-15608 yarn: TOCTOU vulnerability leads to cache pollution
Product: [Other] Security Response Reporter: msiddiqu
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bdettelb, jschorr, nodejs-sig, tomckay, zsvetlik
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yarn-1.19.0 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in Yarn. The package integrity validation in Yarn contains a time-of-check to time-of-use (TOCTOU) vulnerability where the hash is computed before writing a package to cache and is not computed again when reading from the cache. This flaw may lead to a cache pollution attack. The highest threat from this vulnerability is to integrity.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-30 05:20:25 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: 1851876    
Bug Blocks: 1851877    

Description msiddiqu 2020-06-29 10:00:50 UTC
The package integrity validation in yarn < 1.19.0 contains a TOCTOU vulnerability where the hash is computed before writing a package to cache. It's not computed again when reading from the cache. This may lead to a cache pollution attack.

References:

https://github.com/yarnpkg/yarn/blob/master/CHANGELOG.md#1190
https://github.com/yarnpkg/yarn/commit/0474b8c66a8ea298f5e4dedc67b2de464297ad1c
https://hackerone.com/reports/703138

Comment 1 msiddiqu 2020-06-29 10:01:24 UTC
Created nodejs-yarn tracking bugs for this issue:

Affects: fedora-all [bug 1851876]

Comment 2 Jason Shepherd 2020-06-29 23:54:34 UTC
Mitigation:

Run 'yarn cache clean' before installs.

Comment 3 Jason Shepherd 2020-06-29 23:56:35 UTC
Red Hat Quay 3.2 is built with yarn 1.19.1 which has a fix for this issue.

Comment 4 Product Security DevOps Team 2020-06-30 05:20:25 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-2019-15608