Fix CodeQL issues for checked-in yarn binaries#1017
Merged
jonthysell merged 10 commits intomicrosoft:mainfrom Mar 21, 2025
Merged
Fix CodeQL issues for checked-in yarn binaries#1017jonthysell merged 10 commits intomicrosoft:mainfrom
jonthysell merged 10 commits intomicrosoft:mainfrom
Conversation
Contributor
|
Just an FYI, the Node.JS Foundation voted to remove corral from the executable from Node 24 or 25 onwards |
Contributor
Author
Do you mean corepack? That's fine, I only tried enabling it in this PR as a workaround to removing the checked-in yarn 3 cjs files. But since I couldn't get it to work in CI (it worked fine locally) the only option left is to just tell CodeQL to ignore it. |
Yajur-Grover
approved these changes
Mar 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR removes unnecessary
.yarnfolders from the repo and prevents them from being checked-in / scanned by CodeQL in the future.Why
Having yarn binaries checked-in is a security risk and CodeQL complains about issues in the scripts (which we can't fix, or even see, as they're obfuscated as binary files).
Removing the
.yarnfolder for older samples is not a problem, but newer samples which use Yarn 3, such asNativeModuleSample/cpp-lib, need the Yarn 3 binaries checked-in.Unfortunately there's no way to get around this. Yarn refuses to acknowledge this anti-pattern and security issue (see yarnpkg/yarn#7741) and the "solution" to require users to install Yarn 3 via
corepackdoes not work in GitHub CI (see actions/setup-node#480). I've tried every workaround combination in these two issues and none work.Closes #1016
Screenshots
N/A
Microsoft Reviewers: Open in CodeFlow