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

- Severity: High 7.8 (CVSS:3.0, scored by @huntrdev) `CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.30%, higher than 24% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-05-10T00:00:00.000Z
- Modified: 2026-09-10T03:49:40.619Z
- Also known as: GHSA-rm36-94g8-835r
- Weaknesses: CWE-367
- 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.

(As written by CVE List.)

## Affected

- gruntjs gruntjs/grunt: from unspecified before 1.5.3
- grunt (npm): before 1.5.3
- gruntjs grunt: before 1.5.3

## Every score

- @huntrdev: CVSS:3.0 7.8 High `CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 7.0 High `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.0 High `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 6.9 Medium `AV:L/AC:M/Au:N/C:C/I:C/A:C`

## References

- <https://huntr.dev/bounties/0179c3e5-bc02-4fc9-8491-a1a319b51b4d> (exploit, issue-tracking, patch, technical-description, web)
- <https://github.com/gruntjs/grunt/commit/58016ffac5ed9338b63ecc2a63710f5027362bae> (patch, technical-description, web)
- <https://lists.debian.org/debian-lts-announce/2023/04/msg00006.html> (mailing-list, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-1537> (advisory)
- <https://github.com/gruntjs/grunt> (package)

## Sources

- CVE List: [CVE-2022-1537](https://www.cve.org/CVERecord?id=CVE-2022-1537), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-rm36-94g8-835r](https://github.com/advisories/GHSA-rm36-94g8-835r), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2022-1537](https://nvd.nist.gov/vuln/detail/CVE-2022-1537), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-1537 · Whole record: https://cve.day/CVE-2022-1537.json · Rebuilt by cve.day 2026-11-25T22:58:11.525Z
