fix(security): resolve CodeQL code alerts#4648
Open
cl-efornaciari wants to merge 4 commits intomainfrom
Open
Conversation
Resolves CodeQL alerts: #14, #17, #22, #23, #37, #38, #39 - js/insecure-randomness: replace Math.random with crypto.randomInt in util - js/http-to-file-access: validate output filename before file write - js/indirect-command-line-injection: sanitize branch name for shell - js/incomplete-sanitization: replace all apostrophes, not first only - js/prototype-polluting-assignment: skip __proto__/constructor/prototype - js/insufficient-password-hash (#41): false positive, HMAC-SHA256 correct for API signing
🦋 Changeset detectedLatest commit: fc8fdf0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 69 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
- utils.test.ts: use mockImplementationOnce for crypto.randomInt spy to fix TS2345 - swift-dodos-fix.md: escape __proto__ in markdown for Prettier
mxiao-cll
approved these changes
Feb 20, 2026
Contributor
mxiao-cll
left a comment
There was a problem hiding this comment.
This needs to be released given it's high impact
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.
Summary
Alert Table
How Changes Were Made
Math.random()withcrypto.randomInt()ingetRandomEnvandgetRandomRequiredEnv(packages/core/bootstrap/src/lib/util.ts). Updated unit test to spy oncrypto.randomIntinstead ofMath.random.getSafeOutputPath()that validates filename withpath.basename()and rejects path traversal (..).sanitizeBranchForShell()that validates branch name against alphanumeric///-/_/.before interpolating into yarn command.address.replace("'", '')withaddress.replace(/'/g, '')to replace all apostrophes, not just the first.__proto__,constructor, andprototypekeys when copying inputOverrides into combinedOverrides.