CVE-2026-34060
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCreate malicious .vscode/settings.json in project
-
ExploitUser opens project and trusts workspace
-
ExecutionrubyLsp.branch setting interpolated unsanitized
-
ImpactArbitrary Ruby code executes via Gemfile
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Victim must open a VS Code project (or other editor with workspace settings auto-application) containing a malicious |
| Impact | This vulnerability presents high risk despite the absence of a CVSS score, as it enables arbitrary code execution with user privileges through a common developer workflow. The attack vector is network-based in the sense that malicious repositories can be distributed via git hosting platforms, but requires local user interaction (opening and trusting a workspace). Attack complexity is low-exploitation requires only basic knowledge of VS Code workspace settings and Ruby syntax. No authentication beyond normal file system access is required. The technical impact is severe: full code execution in the context of the developer's environment, potentially compromising source code, credentials, and development infrastructure. While no public exploit code exists and the vulnerability is not listed in CISA KEV, the attack surface is significant because developers routinely open external repositories for evaluation, contribution, or dependency review. The vulnerability's real-world risk is amplified by the trust relationship developers have with code repositories, making social engineering attacks highly plausible. Mitigation priority should be high for organizations using ruby-lsp, as auto-update mechanisms may not reach all users, particularly those with locked gem versions or disabled auto-updates. |
| Exploit ScenarioDerived | An attacker creates a seemingly legitimate open-source Ruby project or submits a pull request to an existing repository, embedding a malicious .vscode/settings.json file with a crafted rubyLsp.branch value such as "; |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Mar 27, 2026
Ruby Language Server (ruby-lsp) allows arbitrary code execution when opening malicious projects. The vulnerability exploits unsanitized interpolation of the rubyLsp.branch workspace setting into a generated Gemfile, enabling attackers to embed malicious Ruby code in .vscode/settings.json that executes when users open and trust the workspace. Affects ruby-lsp gem < 0.26.9 and VS Code extension < 0.10.2. No active exploitation or public POC currently identified at time of analysis, but the attack requires only social engineering to trick developers into opening a crafted repository.
RemediationAI
Update the ruby-lsp gem to version 0.26.9 or later and the Ruby LSP VS Code extension to version 0.10.2 or later. For most users, the VS Code extension will auto-update automatically as auto-updates are enabled by default; verify the installed version in the Extensions panel and manually update if necessary by searching for Ruby LSP and clicking Update. For users who include ruby-lsp in their project Gemfile with a locked version, update the Gemfile to specify gem 'ruby-lsp', '>= 0.26.9' and run bundle update ruby-lsp. For users who do not add ruby-lsp to their Gemfiles, the server component should auto-update when the VS Code extension updates. The vendor has removed the vulnerable rubyLsp.branch setting entirely from the extension and the branch CLI flag from the gem, eliminating the attack vector. As an additional security practice, developers should exercise caution when opening and trusting workspaces from unfamiliar or untrusted sources, as workspace settings can modify development environment behavior. Review .vscode/settings.json files in external repositories before trusting workspaces. Full remediation guidance and security advisory available at https://github.com/Shopify/ruby-lsp/security/advisories/GHSA-c4r5-fxqw-vh93.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in rubygems
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
This vulnerability stems from improper neutralization of special elements (CWE-94: Code Injection) in the ruby-lsp language server's Gemfile generation logic. The server accepts a branch parameter via the rubyLsp.branch setting and directly interpolates it into a dynamically generated .ruby-lsp/Gemfile without input validation or sanitization. In VS Code and compatible editors, workspace settings from .vscode/settings.json are automatically applied when users trust a workspace. An attacker can craft a malicious repository containing a .vscode/settings.json with embedded Ruby code in the branch setting value, such as backtick commands or system calls. When the victim opens and trusts the project, the language server generates the Gemfile with the unsanitized input, causing the Ruby interpreter to execute the injected code during Gemfile evaluation. The affected package pkg:rubygems/ruby-lsp is a Language Server Protocol implementation for Ruby that integrates with editors like VS Code to provide IDE features such as autocomplete and diagnostics.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
Lifecycle Timeline
2DescriptionGitHub Advisory
Summary
The rubyLsp.branch VS Code workspace setting was interpolated without sanitization into a generated Gemfile, allowing arbitrary Ruby code execution when a user opens a project containing a malicious .vscode/settings.json.
Other editors that support workspace setting that get automatically applied upon opening the editor and trusting the workspace are also impacted since the server is the component that performs the interpolation.
Details
The branch CLI argument passed to the ruby-lsp server was interpolated in the generated .ruby-lsp/Gemfile without sanitization. Editors that allow defining settings saved at the workspace level (e.g.: .vscode/settings.json) that gets automatically applied open the possibility to craft a malicious repository that once opened and trusted in the editor would run arbitrary code.
Impact
Code execution with the privileges of the user who opens the malicious project. Ruby LSP assumes workspace code is trusted and so opening the editor on an untrusted workspace can lead to executing potentially dangerous code.
Remediation
The rubyLsp.branch setting has been removed entirely. VS Code extensions auto-update by default, so most users will receive the fix without action. Users who have disabled auto-updates should update to extension version >= 0.10.2.
The branch CLI flag was also entirely removed from the ruby-lsp gem. For users that don't add ruby-lsp to their Gemfiles, the server should auto-update. Users with the ruby-lsp in the Gemfile and locked to a specific version should update to >= 0.26.9.
Executive ViewAI
Ruby Language Server (ruby-lsp) gem versions below 0.26.9 and VS Code extension versions below 0.10.2 contain a code execution vulnerability that allows attackers to embed malicious Ruby code in project settings files, which executes when developers open and trust a repository. Development teams using ruby-lsp are at risk of supply chain compromise through social engineering attacks targeting workspace trust prompts.
Until patches are applied: (1) Disable automatic workspace trust or require explicit approval before opening untrusted repositories; (2) Restrict rubyLsp.branch setting modifications in VS Code settings; (3) Implement organization-wide policy prohibiting opening Ruby projects from untrusted external sources without security review; (4) Use code review gates to inspect .vscode/settings.json and Gemfile for suspicious interpolations before trusting workspaces.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
GHSA-c4r5-fxqw-vh93
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB