Vulnerability · Published May 10, 2022 · Assigned by @huntrdev

CVE-2022-1537file.copy operations in GruntJS are vulnerable to a TOCTOU race condition leading to arbitrary file write in gruntjs/grunt

High 7.8

In plain English

A high-severity security flaw in gruntjs/grunt from gruntjs. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 23% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.0)7.8High
Exploit odds (30 days)0.3%top 77.0% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

Official description

file.copy operations in GruntJS are vulnerable to a TOCTOU race condition leading to arbitrary file write in GitHub repository gruntjs/grunt prior to 1.5.3. This vulnerability is capable of arbitrary file writes which can lead to local privilege escalation to the GruntJS user if a lower-privileged user has write access to both source and destination directories as the lower-privileged user can create a symlink to the GruntJS user's .bashrc file or replace /etc/shadow file if the GruntJS user is root.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12grunt1.5.3-1DEBIAN-CVE-2022-1537
Debian:13grunt1.5.3-1DEBIAN-CVE-2022-1537
Debian:14grunt1.5.3-1DEBIAN-CVE-2022-1537
npmgrunt1.5.3GHSA-rm36-94g8-835r

Affected products (as reported)

VendorProductVersions
gruntjs gruntjs/grunt unspecified – before 1.5.3

Weakness: CWE-367 · Vector: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References