Skip to content

[ICM: 31000000706994] Restrict Ruby sandbox access to installed gems - #336474

Draft
azure-pipelines[bot] wants to merge 1 commit into
mainfrom
msrc-resolver/icm-31000000706994-run-474477
Draft

azure-pipelines[bot] wants to merge 1 commit into
mainfrom
msrc-resolver/icm-31000000706994-run-474477

Conversation

@azure-pipelines

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 ~/.gem access with ~/.gem/ruby on 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/jruby or ~/.gem/truffleruby; gem, bundle, and rake will 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',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants