Threat Intel

GHSA-vwf3-4xxj-qg6h: ContextForge prompt templates execute on the gateway

Authenticated template editors can reach Python execution through unsandboxed Jinja2 rendering in the ContextForge gateway.

Armor11 min read

Tracking: GHSA-vwf3-4xxj-qg6h
Severity: High

Who is affected

The Python package mcp-contextforge-gateway before 1.0.0. The researcher verified 0.9.0. Exploitation requires an authenticated user permitted to register or update prompt templates.

How the attack works

PromptService renders stored templates with Jinja2's plain Environment() rather than a sandboxed environment. A malicious template can execute Python when another request renders it on the gateway.

This is server-side template injection. It does not require an LLM to obey a malicious instruction: the executable behavior occurs in the gateway's template engine, with that process's filesystem, network, and credential access.

What to do

  1. Upgrade to 1.0.0 or later and restart the gateway.
  2. Review stored prompt templates and changes made by template editors. Remove suspicious templates after preserving evidence, and check subsequent rendering activity.
  3. Limit template-management privileges and the gateway account's access. Investigate unexpected Python activity or outbound connections before assessing secret exposure.

Scope and limits

The reviewed GitHub advisory has no assigned CVE. Its tracking identifier is GHSA-vwf3-4xxj-qg6h.

Sources

threat-intelmcpremote-code-execution

See what your own fleet is running

Armor1 discovers and risk-scores every MCP server, skill and tool your developers have connected. Free for personal use, no credit card.

Start Free