Skip to content

fix(ng-dev): prevent arbitrary file write via .ng-dev.log symlink#3725

Merged
josephperrott merged 1 commit into
angular:mainfrom
josephperrott:fix-ng-dev-symlink
Jun 3, 2026
Merged

fix(ng-dev): prevent arbitrary file write via .ng-dev.log symlink#3725
josephperrott merged 1 commit into
angular:mainfrom
josephperrott:fix-ng-dev-symlink

Conversation

@josephperrott
Copy link
Copy Markdown
Member

This PR fixes a security vulnerability where an attacker could create a symbolic link named .ng-dev.log pointing to a sensitive file, causing it to be overwritten when ng-dev runs. The fix ensures that if a symbolic link is detected, execution is aborted.

Copy link
Copy Markdown

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

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 updates the external release command arguments from 'set-dist-tag' to 'npm-dist-tag set' and adds a security check in 'ng-dev/utils/logging.ts' to prevent arbitrary file writes via symbolic links. The review feedback correctly identifies a security vulnerability in the new check: 'existsSync' follows symbolic links, meaning the check can be bypassed if the symlink points to a non-existent file. The reviewer suggests calling 'lstatSync' directly and catching 'ENOENT' errors instead, as well as removing the unused 'existsSync' import.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread ng-dev/utils/logging.ts
Comment thread ng-dev/utils/logging.ts
@josephperrott josephperrott requested a review from alan-agius4 June 3, 2026 19:01
@josephperrott josephperrott added the action: merge The PR is ready for merge by the caretaker label Jun 3, 2026
After renaming the npm tagging sub command we failed to update the location where the script is called by the main release process
@josephperrott josephperrott merged commit 9dfe0e4 into angular:main Jun 3, 2026
16 checks passed
@josephperrott
Copy link
Copy Markdown
Member Author

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

@josephperrott josephperrott deleted the fix-ng-dev-symlink branch June 3, 2026 20:15
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.

2 participants