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. 🚀 New features to boost your workflow:
|
erisu
left a comment
There was a problem hiding this comment.
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
| // 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.
| // "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.
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