Skip to content
OpenAdvisories
High · 7.8 CVE-2022-1537 EUVD-2022-5193GHSA-rm36-94g8-835r

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

Published May 10, 2022 · Updated Aug 3, 2024 · Assigned by @huntrdev

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 products

VendorProductAffectedFixed
gruntjs gruntjs/grunt unspecified – < 1.5.3 1.5.3

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 grunt 1.5.3-1 —
Debian 13 grunt 1.5.3-1 —
Debian 12 grunt 1.5.3-1 —
Debian 10 grunt 1.0.1-8+deb10u2 DLA-3383-1
ReleasePackageFixed inAdvisory
Ubuntu Pro 22.04 LTS grunt 1.4.1-2ubuntu0.1~esm1 USN-5847-1
Ubuntu Pro 20.04 LTS grunt 1.0.4-2ubuntu0.1~esm1 USN-5847-1
Ubuntu Pro 18.04 LTS grunt 1.0.1-8ubuntu0.1+esm1 USN-5847-1

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 js-jquery No fix yet —

Affected packages

EcosystemPackageAffectedFixedRecord
npm grunt < 1.5.3 1.5.3 GHSA-rm36-94g8-835r

Advisories 3

References