-
Notifications
You must be signed in to change notification settings - Fork 42
[openApiDiff.ts] Replace exec
with execFile
#370
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
Conversation
@@ -2,23 +2,21 @@ | |||
// Licensed under the MIT License. See License.txt in the project root for license information. | |||
|
|||
import * as asyncFs from "@ts-common/fs" | |||
import * as jsonParser from "@ts-common/json-parser" |
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.
unrelated unused import
exec
with execFile
exec
with execFile
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.
Pull Request Overview
This PR replaces the use of child_process.exec()
with execFile()
to improve security by eliminating shell command injection vulnerabilities. The change removes the need for manual shell argument escaping and simplifies command execution.
- Replaced
exec
withexecFile
in openApiDiff.ts for safer command execution - Removed shell-quote dependency and related escaping logic
- Restructured command building to use argument arrays instead of shell strings
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/lib/validators/openApiDiff.ts | Replaced exec with execFile, removed shell escaping functions, restructured command building |
src/test/shellEscapingTest.ts | Removed entire test file as shell escaping is no longer needed |
package.json | Removed shell-quote dependency and its type definitions |
CHANGELOG.md | Added entry documenting the change to execFile |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.