{"id":"CVE-2022-1537","aliases":["CVE-2022-1537","GHSA-rm36-94g8-835r"],"related":[],"kind":"vulnerability","state":"published","title":"file.copy operations in GruntJS are vulnerable to a TOCTOU race condition leading to arbitrary file write in gruntjs/grunt","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"Las operaciones file.copy en GruntJS son vulnerables a una condición de carrera TOCTOU conllevando una escritura arbitraria de archivos en el repositorio de GitHub gruntjs/grunt versiones anteriores a 1.5.3. Esta vulnerabilidad es capaz de realizar escrituras arbitrarias en archivos que pueden conllevar a una escalada de privilegios local para el usuario de GruntJS si un usuario menos privilegiado presenta acceso de escritura a los directorios de origen y destino, ya que el usuario menos privilegiado puede crear un enlace simbólico al archivo .bashrc del usuario de GruntJS o reemplazar el archivo /etc/shadow si el usuario de GruntJS es root","source":"nvd"}],"published":"2022-05-10T00:00:00.000Z","modified":"2026-09-10T03:49:40.619Z","severity":{"scorer":"@huntrdev","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"@huntrdev","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:M/Au:N/C:C/I:C/A:C","score":6.9,"rating":"MEDIUM"}],"cwes":["CWE-367"],"affected":[{"ranges":[{"type":"custom","introduced":"unspecified","fixed":"1.5.3","status":"affected"}],"vendor":"gruntjs","product":"gruntjs/grunt","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.5.3"}],"ecosystem":"npm","package":"grunt","purl":"pkg:npm/grunt","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.5.3"}],"vendor":"gruntjs","product":"grunt","cpe":"cpe:2.3:a:gruntjs:grunt:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://huntr.dev/bounties/0179c3e5-bc02-4fc9-8491-a1a319b51b4d","tags":["exploit","issue-tracking","patch","technical-description","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/gruntjs/grunt/commit/58016ffac5ed9338b63ecc2a63710f5027362bae","tags":["patch","technical-description","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/04/msg00006.html","tags":["mailing-list","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-1537","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/gruntjs/grunt","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"@huntrdev","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-1537","url":"https://www.cve.org/CVERecord?id=CVE-2022-1537","licence":"CVE Terms of Use","modified":"2024-08-03T00:10:03.294Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rm36-94g8-835r","url":"https://github.com/advisories/GHSA-rm36-94g8-835r","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:40.619Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-1537","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-1537","licence":"Public domain","modified":"2026-06-17T04:22:38.090Z"}],"updatedAt":"2026-11-25T22:58:11.525Z","epss":{"score":0.00302,"percentile":0.2466,"date":"2026-12-01T12:00:22.000Z"}}