WS-2026-0038
Published:August 28, 2026
Updated:August 31, 2026
mcpgateway.services.prompt_service.PromptService renders user-supplied prompt templates using Jinja2 plain Environment() instead of SandboxedEnvironment. An authenticated user with permission to register or update prompt templates can store a malicious template that, on subsequent rendering, executes arbitrary Python code on the gateway host with the privileges of the gateway process. Fixed in 1.0.0, which switches the renderer to SandboxedEnvironment.
Affected Packages
https://github.com/IBM/mcp-context-forge.git (GITHUB):
Affected version(s) >=v0.1.0 <v1.0.0Fix Suggestion:
Update to version v1.0.0mcp-contextforge-gateway (PYTHON):
Affected version(s) >=0.1.0 <1.0.0Fix Suggestion:
Update to version 1.0.0Related Resources (4)
Do you need more information?
Contact UsCVSS v4
Base Score:
8.7
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
LOW
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
CVSS v3
Base Score:
8.8
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Weakness Type (CWE)
Improper Neutralization of Special Elements Used in a Template Engine