CVE-2026-34060: Ruby lsp Ruby LSP Has Arbitrary Code Vulnerability
HIGHCVE-2026-34060 is a HIGH ruby lsp has arbitrary code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Ruby lsp libraries in the RubyGems ecosystem. The issue involves ruby lsp has arbitrary code execution through branch setting. Remediation is available by upgrading affected packages to version 0.26.9.
CVE-2026-34060 at a Glance
How to Fix CVE-2026-34060
To remediate this vulnerability, upgrade all affected Ruby lsp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade ruby-lsp to 0.26.9
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for ruby-lsp
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-34060, inspect your project dependencies for Ruby lsp:
inspect dependencies for ruby-lsp
Analyze the terminal output to locate any version of Ruby lsp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.26.9), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Ruby lsp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-34060 Affected Ruby lsp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ruby-lsp
|
RubyGems |
< 0.26.9
|
0.26.9
|
References
Frequently Asked Questions
What is CVE-2026-34060?
Which Ruby lsp versions are affected?
What version fixes CVE-2026-34060?
Is ruby-lsp affected?
What CWE is associated with CVE-2026-34060?
How can I check RubyGems dependencies for CVE-2026-34060?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c4r5-fxqw-vh93",
"modified" : "2026-03-31T18:41:33Z",
"published" : "2026-03-27T19:43:14Z",
"aliases" : [ "CVE-2026-34060" ],
"summary" : "Ruby LSP has arbitrary code execution through branch setting",
"details" : "**Summary**\n\nThe `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`.\n\nOther 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.\n\n**Details**\n\nThe `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.\n\n**Impact**\n\nCode 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.\n\n**Remediation**\n\nThe `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.\n\nThe `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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "ruby-lsp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.26.9"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Shopify/ruby-lsp/security/advisories/GHSA-c4r5-fxqw-vh93"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34060"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Shopify/ruby-lsp"
}, {
"type" : "WEB",
"url" : "https://github.com/Shopify/ruby-lsp/releases/tag/v0.26.9"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/ruby-lsp/CVE-2026-34060.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-27T19:43:14Z",
"nvd_published_at" : "2026-03-31T03:15:58Z"
}
}