-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Account for Node security patch #1778
Conversation
As of https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2#command-injection-via-args-parameter-of-child_processspawn-without-shell-option-enabled-on-windows-cve-2024-27980---high Cordova produce unrecognized error on Windows. Fixes: apache/cordova-cli#456
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1778 +/- ##
=======================================
Coverage 72.50% 72.50%
=======================================
Files 23 23
Lines 1837 1837
=======================================
Hits 1332 1332
Misses 505 505 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm if this change is valid?
The article you're linking is about Node.js spawn
while the code appears to be using the npm package execa
and the README for version 5.1.1 of this package does not to mention spawn
as a valid option.
The article is talking about the https://www.npmjs.com/package/execa/v/5.1.1#shell Bit curious, since the dependency suggests setting it is
But since we are defining the bat file and not taking in user arg, it should be OK. |
I assume execa is using This is from the NodeJS docs
The security concern arises if we are passing in user supplied values, which we are not:
I do think we should comment why we are using |
Co-authored-by: Norman Breau <norman@breautek.com>
lib/check_reqs.js
Outdated
@@ -110,7 +110,9 @@ module.exports.get_gradle_wrapper = function () { | |||
let program_dir; | |||
// OK, This hack only works on Windows, not on Mac OS or Linux. We will be deleting this eventually! | |||
if (module.exports.isWindows()) { | |||
const result = execa.sync(path.join(__dirname, 'getASPath.bat')); | |||
// "spawn" option enabled for CVE-2024-27980 (Windows) Mitigation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// "spawn" option enabled for CVE-2024-27980 (Windows) Mitigation | |
// "shell" option enabled for CVE-2024-27980 (Windows) Mitigation |
I wrote in "spawn" because that was in the original PR but since we determine the "shell" option is correct, that should be reflected in the comment too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good to me.
As of https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2#command-injection-via-args-parameter-of-child_processspawn-without-shell-option-enabled-on-windows-cve-2024-27980---high Cordova produce unrecognized error on Windows.
Fixes: apache/cordova-cli#456