# CVE-2026-81097: rails-mcp-server 1.4.0 through 1.6.0 OS Command Execution via execute_ruby PTY Escape

> Attackers can execute arbitrary OS commands via the execute_ruby tool in rails-mcp-server due to missing pseudo-terminal restrictions in the sandbox.

- **Severity:** High 8.6 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 27 Aug 2026
- **Updated:** 29 Aug 2026
- **Also known as:** GHSA-247c-497m-jx82

## What is CVE-2026-81097?

CVE-2026-81097 is a high-severity command injection vulnerability in maquina-app rails-mcp-server, published on 27 Aug 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2026-81097?


## How do I fix CVE-2026-81097?

No fix has been published for CVE-2026-81097 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-81097 being exploited?

There is no known exploitation of CVE-2026-81097 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-81097 and fix it if it is affected.

What it is: CVE-2026-81097 is a high-severity command injection vulnerability in maquina-app rails-mcp-server, published on 27 Aug 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-81097 in the wild and no public exploit code.

Affected product: maquina-app rails-mcp-server. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-81097/ (Markdown: https://insights.sbomify.com/CVE-2026-81097/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-81097
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-81097
- OSV: https://osv.dev/vulnerability/CVE-2026-81097

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-81097/
Summaries are generated and may contain mistakes; the official description above is the record.
