bump serialize-javascript to v7.0.4; replace crypto-browserify with built-in crypto#8606
Draft
bump serialize-javascript to v7.0.4; replace crypto-browserify with built-in crypto#8606
Conversation
…/hash.js Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/b051a380-1d06-421c-8a89-e025f736ed2a
…ead of md5.js/hash.js Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/b051a380-1d06-421c-8a89-e025f736ed2a
Copilot created this pull request from a session on behalf of
rzhao271
March 20, 2026 20:12
View session
Contributor
|
@copilot In browser, use subtlecrypto digest |
…ync through parse functions Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/02d6fd03-1129-4492-ab95-06726304775e
Contributor
Author
Done in b244a34. |
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.
serialize-javascript ≤7.0.2has a high-severity RCE CVE.crypto-browserifypulls in pure-JSmd5.jsandhash.jswhere Node.js built-in crypto suffices.package.json— override serialize-javascript to 7.0.4"serialize-javascript": "7.0.4") instead of nested undermocha, since mocha declares^6.0.2and npm's flat override bypasses the semver range constraint.src/github/utils.ts— drop thecryptomodule importimport * as crypto from 'crypto'(resolved by webpack tocrypto-browserify) with an asyncsha256Hex()helper:require(/* webpackIgnore: true */ 'crypto').createHash('sha256')so webpack doesn't bundle the call.globalThis.crypto.subtle.digest('SHA-256', ...)(SubtleCrypto).SubtleCrypto.digestis async,getAvatarWithEnterpriseFallbackand all downstream parsing functions (parseAccount,parseGraphQLComment,parseGraphQLReviewThread,parseGraphQLReviewEvent,parseGraphQLReviewers,parseCombinedTimelineEvents, etc.) inutils.ts,githubRepository.ts,pullRequestModel.ts, andissueModel.tsare updated to beasyncwith appropriateawait/Promise.allusage.webpack.config.js— remove crypto-browserify from browser/webworker bundlescrypto: false(wasrequire.resolve("crypto-browserify")) in theresolve.fallbackfor both the webview (target: 'web') and extension webworker (target: 'webworker') configs.crypto-browserifyand its transitive deps (md5.jsviacreate-hash/browser.js,hash.jsviaelliptic → browserify-sign) from all bundles. All affected webview/webworker code that needs randomness already usesglobalThis.cryptodirectly (e.g.uuid's browser build).⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.