NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

CVE-2026-106763: @justice8096/sagemath-mcp-server: executes arbitrary code via the escapeShellString and sanitizeCode functions

highCVSS 3.1 7.5GHSA-2vq3-mpmf-9xgr

@justice8096/sagemath-mcp-server 1.0.1 and earlier lets an attacker run arbitrary commands through arguments the model passes to its Sage math tools. The advisory points at the escapeShellString and sanitizeCode functions. No patched version exists yet. Avoid local execution mode, or stop using the server, until the maintainer ships a fix.

Published Oct 23, 2026 · Updated Oct 29, 2026 · Analysis Oct 30, 2026

What an attacker can do

The server runs SageMath code. In local execution mode, which it selects automatically when Sage is installed on the host, tool arguments pass through escapeShellString and sanitizeCode before they reach a shell. The advisory says these functions do not stop code execution. The reporter says every math tool is reachable, not just one.

The trigger is a tool argument, so indirect prompt injection can deliver it. A document, web page or chat message that the model reads can steer the model into sending a crafted argument to a Sage tool. The CVSS vector reflects this: network attack, high complexity, user interaction required. The result is code execution with the privileges of the MCP server process, so files, environment variables and credentials of that user are exposed.

The public issue gives no payload or code path. The reporter says they plan to share remediation details privately, so the exact bypass is not documented in the sources.

Who is affected

The advisory lists @justice8096/sagemath-mcp-server 1.0.1 as affected, and the data marks all versions up to 1.0.1 as vulnerable. The reporter says the Docker execution path is not affected because it passes the program as an argument array. Local mode is the exposed path. Check the installed version:

npm ls @justice8096/sagemath-mcp-server

If Sage is installed on the same host as the server, assume local mode is active.

@justice8096/sagemath-mcp-server

Ecosystem
npm
Affected
<= 1.0.1
Fixed in
No patched version yet
Check
npm ls @justice8096/sagemath-mcp-server

How to fix it

There is no patched version yet. The npm package has no release that fixes this, and the maintainer had not replied on the issue when it was published.

The sources suggest one mitigation: use the Docker execution path, which the reporter says is unaffected, and do not run local mode. Otherwise remove the server from your MCP client configuration. Run any remaining instance as an unprivileged user with no secrets in its environment. Watch the repository issue and the npm page for a fixed release.

How to tell if you were hit

No indicators are published. On a host running the server in local mode, look for child processes spawned by the Node process that are not Sage, such as sh, curl or wget. Check outbound connections from that process. Review your MCP client's tool-call logs for Sage tool arguments that contain shell metacharacters or unexpected code. Beam records the MCP tool calls an agent makes and the shell commands it runs, so its rules can flag a suspicious Sage tool call after the fact.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

An issue in @justice8096/sagemath-mcp-server 1.0.1 allows a remote attacker to execute arbitrary code via the escapeShellString and sanitizeCode functions.

Credited to stillmarcus24.

Questions

Is there a fix for CVE-2026-106763?

Not yet. No patched version of @justice8096/sagemath-mcp-server is listed. The reporter offered remediation details privately, and the maintainer had not responded on the issue.

Does the Docker mode of the Sage MCP server avoid this?

The reporter says yes. The Docker path passes the program as an argument array, while the vulnerable local mode builds a shell command. This is the reporter's claim, and I could not confirm it in code.

Can this be triggered by prompt injection?

Yes, in principle. The flaw is reached through tool arguments the model supplies, so content the model reads could cause it to send a malicious argument. The vector marks user interaction as required.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries