---
title: "GHSA-hjxc-462x-x77j: TOCTOU Race Condition in Yarn"
description: "Moderate severity. TOCTOU Race Condition in Yarn. Affects yarn; fixed in 1.19.0."
url: https://inlinr.com/advisories/GHSA-hjxc-462x-x77j
lang: en
---

[Packages](https://inlinr.com/packages) / [yarn](https://inlinr.com/packages/yarn) / [Security](https://inlinr.com/packages/yarn/security)

Moderate Vulnerability GHSA-hjxc-462x-x77j CVE-2019-15608 Published 9 Feb 2022

# TOCTOU Race Condition in Yarn

Your version 

Affected releases · [yarn](https://inlinr.com/packages/yarn)

- 1.x 1.0.0 – 1.18.0 Fixed in 1.19.0
- 0.28.x and older 0.1.0 – 0.28.4 No fix, no longer updated

On 1.x, the newest line:

```
npm install yarn@1.19.0
```

Every release on a timeline

2.x 

1. Not affected

2.4.3  
1 release

1.x 

1. Affected

1.0.0 – 1.18.0  
35 releases
2. Fixed

1.19.0 – 1.22.22  
26 releases, latest

0.x 

1. Affected

0.1.0 – 0.28.4  
56 releases

118 stable releases of yarn, oldest to newest, one row per major.

## What happens

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. This issue is fixed in 1.19.0.

## How it is exploited

Exploitable over the network, with no account and no action from a user.

- **Confidentiality**: none
- **Integrity**: high
- **Availability**: none

CVSS:3.1/​AV:N/​AC:H/​PR:N/​UI:N/​S:U/​C:N/​I:H/​A:N

## References

- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2019-15608 "https://nvd.nist.gov/vuln/detail/CVE-2019-15608")  
nvd.nist.gov/vuln/detail/CVE-2019-15608
- [Fix commit](https://github.com/yarnpkg/yarn/commit/0474b8c66a8ea298f5e4dedc67b2de464297ad1c "https://github.com/yarnpkg/yarn/commit/0474b8c66a8ea298f5e4dedc67b2de464297ad1c")  
0474b8c
- [Reference](https://hackerone.com/reports/703138 "https://hackerone.com/reports/703138")  
hackerone.com/reports/703138
- [Reference](https://github.com/yarnpkg/yarn/blob/master/CHANGELOG.md#1190 "https://github.com/yarnpkg/yarn/blob/master/CHANGELOG.md#1190")  
github.com/yarnpkg/yarn/blob/master/CHANGELOG.md

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
