[ICM: 31000000706994] Restrict Ruby sandbox access to installed gems - #336474
Draft
azure-pipelines[bot] wants to merge 1 commit into
Draft
azure-pipelines[bot] wants to merge 1 commit into
azure-pipelines[bot] wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new path excludes user-installed gems for non-MRI engines such as JRuby and TruffleRuby.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Narrows Ruby terminal sandbox access to reduce exposure within the user gem directory.
Changes:
- Replaces
~/.gemaccess with~/.gem/rubyon macOS and Linux. - Adds tests covering Ruby-related command keywords.
File summaries
| File | Description |
|---|---|
terminalSandboxReadAllowList.ts |
Narrows Ruby sandbox read paths. |
terminalSandboxReadAllowList.test.ts |
Verifies Ruby command allow-list paths. |
Review details
Suppressed comments (1)
src/vs/platform/sandbox/common/terminalSandboxReadAllowList.ts:286
- This hard-codes MRI's RubyGems user directory. RubyGems derives this segment from the runtime engine, so user-installed gems for engines such as JRuby or TruffleRuby live under
~/.gem/jrubyor~/.gem/truffleruby;gem,bundle, andrakewill lose access to them on Linux. Please retain narrowly scoped roots for the supported Ruby engines and update the shared expectation accordingly.
'~/.gem/ruby',
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| case OperatingSystem.Macintosh: | ||
| return [ | ||
| '~/.gem', | ||
| '~/.gem/ruby', |
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.
https://portal.microsofticm.com/imp/v3/incidents/details/31000000706994/home