Skip to content

fix(ng-dev): prevent current working directory executable injection on Windows - #3905

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix-win32-cwd-exec-injection
Aug 6, 2026
Merged

fix(ng-dev): prevent current working directory executable injection on Windows#3905
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix-win32-cwd-exec-injection

Conversation

@alan-agius4

Copy link
Copy Markdown
Contributor

Sets NoDefaultCurrentDirectoryInExePath=1 during CLI initialization on Windows to ensure CreateProcess does not include the current working directory in the search path when resolving bare executable names.

Fixes #3897

…n Windows

Sets NoDefaultCurrentDirectoryInExePath=1 during CLI initialization on Windows
to ensure CreateProcess does not search the current working directory for bare
executable names.

Fixes angular#3897
@alan-agius4
alan-agius4 requested a review from clydin August 6, 2026 12:18
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Aug 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a platform check to set the NoDefaultCurrentDirectoryInExePath environment variable on Windows, preventing the search of the current directory for bare executables. The review feedback correctly points out that setting this variable inside the runParserWithCompletedFunctions callback occurs after ES module imports are resolved and evaluated, potentially leaving subprocesses spawned during module evaluation unprotected. It is recommended to move this configuration to the very top of the entry point file, before any imports.

Comment thread ng-dev/cli.ts
@alan-agius4
alan-agius4 merged commit 92c6b59 into angular:main Aug 6, 2026
17 checks passed
@alan-agius4

Copy link
Copy Markdown
Contributor Author

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prompt.editor spawns a bare notepad with no cwd, so on Windows it runs an executable from the repository being reviewed

2 participants