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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | grunt | 1.5.3-1 | DEBIAN-CVE-2022-1537 |
| Debian:13 | grunt | 1.5.3-1 | DEBIAN-CVE-2022-1537 |
| Debian:14 | grunt | 1.5.3-1 | DEBIAN-CVE-2022-1537 |
| npm | grunt | 1.5.3 | GHSA-rm36-94g8-835r |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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