Medium

TOCTOU Race Condition in Yarn

  • Disclosed: 09.02.2022
  • Updated: 11.10.2026 10:22

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package yarn < 1.19.0 1.19.0

References

CVSS score 5.9/10
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Weakness (CWE)
CWE-367
Platform
npm
Package
yarn
Disclosed
09.02.2022
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-hjxc-462x-x77j - CC BY 4.0

Vulnerability history: yarn

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
5
First → latest
07.2019 02.2024
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 4
  • Medium 1

Disclosures per year

  1. 2019: 1
  2. 2020: 1
  3. 2021: 0
  4. 2022: 2
  5. 2023: 0
  6. 2024: 1
  7. 2025: 0
  8. 2026: 0
  1. High · 7.7 CVE-2021-4435 < 1.22.13 1.22.13
  2. TOCTOU Race Condition in Yarn this entry
    Medium · 5.9 CVE-2019-15608 < 1.19.0 1.19.0
  3. High · 7.5 CVE-2020-8131 < 1.22.0 1.22.0
  4. High · 7.8 CVE-2019-10773 < 1.22.0 1.22.0
  5. High · 8.1 CVE-2019-5448 < 1.17.3 1.17.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.