Packages / yarn / Security

ModerateVulnerabilityGHSA-hjxc-462x-x77jCVE-2019-15608Published 9 Feb 2022

TOCTOU Race Condition in Yarn

Your version

Affected releases · yarn

  • 1.x1.0.0 – 1.18.0Fixed in 1.19.0
  • 0.28.x and older0.1.0 – 0.28.4No 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.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.