ContextForge CVE-2026-53710 and Chainlit CVE-2026-45018: Allowlists and Denylists Around MCP Keep Failing

Somewhere in your agent stack, a piece of code decides what may run, and it decides by reading text: a binary name, a string of Python. Two advisories published this week, one day apart, show what that check is worth. If you run Chainlit with MCP turned on, or ContextForge's Python sandbox server over HTTP, patch today.
| At a glance | ContextForge python_sandbox_server | Chainlit /mcp |
|---|---|---|
| Identifier | CVE-2026-53710, GHSA-xm98-3vcf-fph7 | CVE-2026-45018, GHSA-w3fx-mc44-mf6j |
| Affected | pip mcp-contextforge-gateway <= 1.0.1 per the advisory, this sub-project only | pip chainlit >= 2.4.0rc0, < 2.12.0, only with features.mcp.enabled = true |
| Fixed in | >= 1.0.2 per the advisory; the fix is in the v1.0.2 source, not the PyPI wheel | 2.12.0 |
| Severity | Critical in the GitHub advisory, no scorer named: 9.0 HTTP, 8.8 stdio floor | 9.8 Critical in the GitHub advisory, no scorer named; NVD repeats it, sourced from GitHub |
| Exploited as of 2026-08-26 | None reported, PoC in advisory, not in CISA KEV | None reported, not in CISA KEV; CISA SSVC on the NVD record says poc, automatable |
| Disclosed | 2026-08-24, fix in the v1.0.2 release since 2026-05-26 | 2026-08-25, reported 2026-04-08 by external researchers |
Keep the scope straight: IBM's advisory says "The core ContextForge gateway and proxy components are not directly affected," and Chainlit's MCP support has been off by default since 2.7.0.
The sources disagree twice. ContextForge's advisory says 9.0, but its listed vector (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H) computes to 10.0, and NVD has no entry yet. The Critical rating assumes HTTP reachability, so your transport matters more than the decimal. Chainlit's sidebar says <= 2.11.1 with no patch, while its body says < 2.12.0, patched in 2.12.0. PyPI has 2.12.0 from 2026-08-25, so go with the body.
One more trap on the ContextForge side. The advisory's affected package is pip mcp-contextforge-gateway, but the file it names as the component is not in that package. The gateway's packaging config keeps only packages starting with mcpgateway, and the 1.0.2 wheel and sdist on PyPI have no sandbox path. The sandbox has its own pyproject.toml as python-sandbox-server 2.0.0, and v1.0.1 says the same, so its version number cannot tell you whether you have the fix.
Chainlit: an allowlist that read one word
POST /mcp accepted a client-supplied fullCommand string. Per the advisory, validate_mcp_command() split it with shlex.split(), checked only the executable name, and passed the arguments straight to StdioServerParameters. npx looks safe to allow, and it supports -c, which runs a shell command. The check passes and the attacker chooses the rest.
Three details make it worse:
allowed_executablesdefaults toNone, and the code treatsNoneas "allow everything."- The route is always registered. Only the runtime flag and any configured auth guard it, and without an auth callback a client needs just a session id, with no login.
- Chainlit's write-up says: "The server spawned the subprocess before the MCP handshake completed, so the shell command executed even though the MCP connection subsequently failed." A failed connection in your logs proves nothing.
It also gives the verdict: "No argument-level filtering can safely sandbox this because the attacker controls the full argument list." So 2.12.0 removes the input. A client used to send a command line. Now it sends a session id and a name, and stdio servers are declared server-side under [[features.mcp.servers]].
ContextForge: a denylist that read the source
The execute_code tool runs user Python under RestrictedPython. The advisory lists three weaknesses: raw getattr in safe_builtins, validate_code looking for literal dunder strings, and execute_code being exposable over HTTP/SSE with no authentication.
The fix commit counts four, adding that the _getattr_ guard was missing from globals and that the builtins merge order let raw getattr overwrite RestrictedPython's entries. On the validator it is blunt: "trivially bypassed by '__cla' + 'ss__'". The advisory's PoC builds dunder names at runtime and walks the class hierarchy to subprocess.Popen, while validation reports 'valid': True.
Anyone who can reach the endpoint gets OS commands with the server process's privileges. The advisory warns of filesystem compromise or pivoting where a container has host mounts or internal reachability.
Now the dates. The v1.0.2 release was published on 2026-05-26. Its notes mention other hardening but not the sandbox, even though the fix commit in that release, dated 2026-05-25, already names the GHSA id and describes the escape. The advisory came about three months later, and until then anything deciding upgrades from advisories had nothing to match.
What to check and do now
- ContextForge. Find every deployment of
python_sandbox_server, and treatmcp-contextforge-gateway<= 1.0.1as the advisory's version marker for it. The sandbox server is not in the PyPI wheel, so upgrading the gateway with pip does not patch it. Redeploy it from v1.0.2 or later source. The code lives atmcp-servers/python/python_sandbox_server, so I would check source checkouts and images too. - Set the token first. Over HTTP, fixed versions require
SANDBOX_API_TOKEN, at least 32 characters, sent as a bearer token. The server exits if it is unset. - Chainlit. Find
chainlit>= 2.4.0rc0, < 2.12.0and read.chainlit/config.toml. The off default only dates from 2.7.0, so do not assume it. - Upgrade to 2.12.0 and migrate. Legacy
[features.mcp.sse],[features.mcp.stdio]and[features.mcp.streamable-http]sections, orallowed_executables, stop the app starting once MCP is enabled. This release also fixes CVE-2026-45019, an SSRF scored 7.2. - If you cannot upgrade today, set
features.mcp.enabled = false, which covers both Chainlit CVEs. An auth callback narrows who can reach/mcpbut does not fix the injection. Block egress to internal networks and cloud metadata. - Add auth after upgrading too. Per the advisory, 2.12.0 with no auth still lets anonymous clients spawn your configured stdio servers by name, with no resource limits or per-client session cap.
- Look back. Neither advisory gives indicators of compromise. My inference, not sourced guidance: search for
POST /mcpbodies containingfullCommand, and for unexpectednpxorshchildren of either server process.
What to enforce instead
Stdio makes a server definition a process launch, so whoever influences that definition chooses what your host runs. Chainlit policed that by reading command text, and ContextForge's validator did the same to Python source. ContextForge's fix adds a dunder allowlist of its own, enforced on actual attribute access. Lists are fine. What fails is a list applied to a string the attacker wrote.
What I would hold to in any agent stack:
- Callers pick a name, never a command. Operators declare commands server-side, and no request body carries a command or its arguments.
- Authenticate before you spawn, and fail closed. Chainlit's
Nonemeant allow everything, and ContextForge kept a fallbackeval/execpath for when RestrictedPython was unavailable. Exiting on a missing token is the behaviour to copy. - Assume the language sandbox falls. AST checks and guarded attribute access beat substring matching, and I still would not make them the boundary. vm2 last week is the same story in another language. Run code execution tools with no host mounts, no credentials and no route to internal networks.
- Treat config and transport as part of the vulnerability. A version match flags a ContextForge gateway install that does not contain the sandbox server and a Chainlit app with MCP off, misses a sandbox server whose own version did not change with the fix, and told you nothing during ContextForge's three month gap.
Today, search your repositories and images for chainlit, mcp-contextforge-gateway, python_sandbox_server and python-sandbox-server. For each hit, name the authentication check that runs before any process starts. If you cannot name one, that is your next fix.
References
- IBM (GitHub Security Advisory), GHSA-xm98-3vcf-fph7, 2026-08-24
- IBM (GitHub commit), d6c8c61, 2026-05-25
- IBM (GitHub release), v1.0.2, 2026-05-26
- IBM (GitHub repository), gateway pyproject.toml at v1.0.2, 2026-05-26
- IBM (GitHub repository), python_sandbox_server pyproject.toml at v1.0.2, 2026-05-26
- IBM (GitHub repository), python_sandbox_server pyproject.toml at v1.0.1, 2026-05-13
- PyPI, mcp-contextforge-gateway 1.0.2 metadata, uploaded 2026-05-26
- Chainlit (GitHub Security Advisory), GHSA-w3fx-mc44-mf6j, 2026-08-25
- Chainlit (GitHub repository), Security Advisory: MCP Endpoint Vulnerabilities, 2026-08-25
- PyPI, chainlit 2.12.0 metadata, uploaded 2026-08-25
- NVD, CVE-2026-45018, 2026-08-25
- CISA, Known Exploited Vulnerabilities Catalog, living catalog
