Vulnerabilities in pkg:npm/grunt
PACKAGECVE-2022-1537 is a HIGH (CVSS 7.0) race condition vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Grunt libraries in the npm ecosystem. The issue involves race condition in grunt. Remediation is available by upgrading affected packages to version 1.5.3.
pkg:npm/grunt
Vulnerability advisories affecting package pkg:npm/grunt. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-rm36-94g8-835r | CVE-2022-1537 | HIGH | Race Condition in Grunt |
| GHSA-j383-35pm-c5h4 | CVE-2022-0436 | MODERATE | Path Traversal in Grunt |
| GHSA-m5pj-vjjf-4m3h | CVE-2020-7729 | HIGH | Arbitrary Code Execution in grunt |
CVE-2022-1537 at a Glance
Security Impact
CVSS: 7.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-1537
To remediate this vulnerability, upgrade all affected Grunt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install grunt@1.5.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls grunt
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-1537, inspect your project dependencies using npm:
npm ls grunt
Analyze the terminal output to locate any version of Grunt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.3), your application is affected.
Note: The npm ls grunt command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In Grunt, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-1537 Affected Grunt Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
grunt
|
npm |
< 1.5.3
|
1.5.3
|
References
Frequently Asked Questions
What is CVE-2022-1537?
Which Grunt versions are affected?
What version fixes CVE-2022-1537?
Is grunt affected?
What is the CVSS score of CVE-2022-1537?
What CWE is associated with CVE-2022-1537?
How can I check npm dependencies for CVE-2022-1537?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rm36-94g8-835r",
"modified" : "2022-05-25T19:30:09Z",
"published" : "2022-05-11T00:01:37Z",
"aliases" : [ "CVE-2022-1537" ],
"summary" : "Race Condition in Grunt",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "grunt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.5.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-1537"
}, {
"type" : "WEB",
"url" : "https://github.com/gruntjs/grunt/commit/58016ffac5ed9338b63ecc2a63710f5027362bae"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gruntjs/grunt"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/0179c3e5-bc02-4fc9-8491-a1a319b51b4d"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/04/msg00006.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-367" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-05-25T19:30:09Z",
"nvd_published_at" : "2022-05-10T14:15:00Z"
}
}