Skip to content

Conversation

@st0012
Copy link
Member

@st0012 st0012 commented Jan 27, 2026

Motivation

Ruby LSP, by design, can execute code (e.g. run bundle install) when the user simply opening the project in VS Code under trusted mode. This is necessary for usability and it's a common practice among language servers and their extensions. But the risk should be clearly communicated with users.

Implementation

Add a page to document known (but not exhaustive) code executions that could be performed by Ruby LSP so users can be aware of the potential risks.

Automated Tests

Manual Tests

@st0012 st0012 self-assigned this Jan 27, 2026
@st0012 st0012 requested a review from a team as a code owner January 27, 2026 22:10
@st0012 st0012 added documentation Improvements or additions to documentation vscode This pull request should be included in the VS Code extension's release notes server This pull request should be included in the server gem's release notes labels Jan 27, 2026

- Execute any code in your Gemfile (Gemfiles are Ruby code)
- Install gems specified in the Gemfile, which may include native extensions that execute during installation
- Run any post-install hooks defined by gems
Copy link
Member

Choose a reason for hiding this comment

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

Does RubyGems allow for post-install hooks? I thought you could only show messages.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not a direct post-install hook. But you can use spec.rdoc_options to specify what RDoc should run to generate your gem's documentation for ri (which will be invoked by rubygems), including running your rdoc options etc.

Copy link
Member

Choose a reason for hiding this comment

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

Really? I had no idea.


- Execute any code in your Gemfile (Gemfiles are Ruby code)
- Install gems specified in the Gemfile, which may include native extensions that execute during installation
- Run any post-install hooks defined by gems
Copy link
Member

Choose a reason for hiding this comment

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

Really? I had no idea.

Co-authored-by: Vinicius Stock <vinistock@users.noreply.github.com>
@st0012 st0012 enabled auto-merge (squash) January 28, 2026 16:07
@st0012 st0012 disabled auto-merge January 28, 2026 16:58
@st0012 st0012 merged commit 6363ff7 into main Jan 28, 2026
36 checks passed
@st0012 st0012 deleted the add-security-doc branch January 28, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation server This pull request should be included in the server gem's release notes vscode This pull request should be included in the VS Code extension's release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants