Skip to content

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

HighCVSS 7.0 EPSS 0.30%
Published
Updated
Exploit status
No public exploit known
Technology
UbuntuDebian

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.

Upgrade path

10 packages: 10 fixed.

PackageAffectedFixed inStatus
debian/grunt(Debian 12) < 1.5.3-1 1.5.3-1 Fixed
debian/grunt(Debian 13) < 1.5.3-1 1.5.3-1 Fixed
debian/grunt(Debian 14) < 1.5.3-1 1.5.3-1 Fixed
gruntjs grunt < 1.5.3 1.5.3 Fixed
gruntjs/grunt < 1.5.3 1.5.3 Fixed
npm grunt(npm) < 1.5.3 1.5.3 Fixed
ubuntu/grunt(Ubuntu 22.04) < 1.4.1-2ubuntu0.1~esm1 1.4.1-2ubuntu0.1~esm1 Fixed
ubuntu/grunt(Ubuntu Pro 18.04) < 1.0.1-8ubuntu0.1+esm1; = 1.0.1-5; = 1.0.1-6; = 1.0.1-7 +2 more 1.0.1-8ubuntu0.1+esm1 Fixed
ubuntu/grunt(Ubuntu Pro 20.04) < 1.0.4-2ubuntu0.1~esm1; = 1.0.1-9; = 1.0.4-2 1.0.4-2ubuntu0.1~esm1 Fixed
ubuntu/grunt(Ubuntu Pro 22.04) < 1.4.1-2ubuntu0.1~esm1; = 1.3.0-1; = 1.3.0-2; = 1.4.1-1 +1 more 1.4.1-2ubuntu0.1~esm1 Fixed

Affected products

ProductAffected versionsFixed in
npm grunt(npm) < 1.5.3 1.5.3
gruntjs/grunt < 1.5.3 1.5.3
ubuntu/grunt(Ubuntu:22.04) < 1.4.1-2ubuntu0.1~esm1 1.4.1-2ubuntu0.1~esm1
gruntjs grunt < 1.5.3 1.5.3
debian/grunt(Debian:12) < 1.5.3-1 1.5.3-1
debian/grunt(Debian:14) < 1.5.3-1 1.5.3-1
debian/grunt(Debian:13) < 1.5.3-1 1.5.3-1
ubuntu/grunt(Ubuntu:Pro:18.04) < 1.0.1-8ubuntu0.1+esm1 1.0.1-8ubuntu0.1+esm1
ubuntu/grunt(Ubuntu:Pro:18.04) = 1.0.1-5 No fix listed
ubuntu/grunt(Ubuntu:Pro:18.04) = 1.0.1-6 No fix listed
ubuntu/grunt(Ubuntu:Pro:18.04) = 1.0.1-7 No fix listed
ubuntu/grunt(Ubuntu:Pro:18.04) = 1.0.1-8 No fix listed
ubuntu/grunt(Ubuntu:Pro:18.04) = 1.0.1-8ubuntu0.1 No fix listed
ubuntu/grunt(Ubuntu:Pro:20.04) < 1.0.4-2ubuntu0.1~esm1 1.0.4-2ubuntu0.1~esm1
ubuntu/grunt(Ubuntu:Pro:20.04) = 1.0.1-9 No fix listed
ubuntu/grunt(Ubuntu:Pro:20.04) = 1.0.4-2 No fix listed
ubuntu/grunt(Ubuntu:Pro:22.04) < 1.4.1-2ubuntu0.1~esm1 1.4.1-2ubuntu0.1~esm1
ubuntu/grunt(Ubuntu:Pro:22.04) = 1.3.0-1 No fix listed
ubuntu/grunt(Ubuntu:Pro:22.04) = 1.3.0-2 No fix listed
ubuntu/grunt(Ubuntu:Pro:22.04) = 1.4.1-1 No fix listed
ubuntu/grunt(Ubuntu:Pro:22.04) = 1.4.1-2 No fix listed

References