Report suspected vulnerabilities privately; do not open a public issue.
- Email redevops@redevops.io (the ReDevOps organisation contact), stating that it is a security report.
Include the commit or tag and a minimal reproduction. The default offline path makes no network calls; real model and retrieval bindings are opt-in extras.
MCPClient.stdio starts the server with an allowlisted environment, not a copy of yours. By default the child receives only
PATH, HOME, USER, LOGNAME, SHELL, LANG, LANGUAGE, LC_*, TZ, TERM, TMPDIR, TEMP, TMP, the Windows
system variables (SYSTEMROOT, SYSTEMDRIVE, WINDIR, COMSPEC, PATHEXT), PYTHONPATH, VIRTUAL_ENV, PYTHONUTF8,
PYTHONIOENCODING, SSL_CERT_FILE, SSL_CERT_DIR, REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE and NO_PROXY, plus the proxy
variables (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY) when their value has no embedded credentials. API keys, tokens,
passwords and cloud or database settings in your environment do not reach the server.
- Give a server what it needs explicitly:
MCPClient.stdio(cmd, env={"MY_SERVICE_TOKEN": token}). The mapping wins over the allowlist. - To restore the previous behaviour (the child inherits the whole parent environment) use
MCPClient.stdio(cmd, inherit_env=True), or setCONTEXT_RUNTIME_MCP_INHERIT_ENV=1for the process. A warning is logged each time the full environment is passed on. An explicitinherit_env=Falseoverrides the variable. - The bundled
deploy_scanserver (mount_deploy_scan) is handed its own settings explicitly (SCAN_ALLOWLIST,SCAN_LIVE, theSCAN_ZAP_*,SCAN_NMAP_PORTSandSCAN_NUCLEI_TEMPLATESoptions, andDOCKER_HOSTandDOCKER_CONTEXTfor live scans), and nothing else from your environment.
The list above is deliberately small, and it is also meant to evolve: a server or platform may legitimately need another variable.
An addition is a documented security review, not a prohibition. In the pull request, state (1) which variable and which server or
platform needs it, (2) why passing it through the explicit env mapping is not enough, (3) that its name and value cannot carry a
credential (a name containing KEY, TOKEN, SECRET, PASSWORD or CREDENTIAL does not qualify; a value that may embed credentials is
filtered the way the proxy variables are), and (4) the test that shows it reaches the child. Then update SAFE_ENV_VARS and
REVIEWED_SAFE_ENV_VARS in tests/test_mcp_env_guard.py together; that test exists so that the list never changes unnoticed.
Purpose: the control plane (context_runtime.control_plane.app, the image built by the Dockerfile) serves approvals, jobs, fleet
information, learned policy, retrieval over indexed corpora and an OpenAI-compatible chat route. It answers only callers that
present a configured credential.
- Fails closed. With neither
CONTEXT_RUNTIME_API_KEYnorAGENTIC_OS_API_KEYset (an empty or whitespace-only value counts as unset), every route exceptGET /healthanswers503. With a key set, a missing or wrong credential is401. The credential is sent asX-API-KeyorAuthorization: Bearer. Keys are compared withhmac.compare_digest. - One class per route. Each route is
public(onlyGET /health, which returns{"status": "ok"}),readeroradmin. A route that is not classified is refused, andtests/test_control_plane_access.pyfails when the route table and its expected classes differ.
| Class | Credential | Routes |
|---|---|---|
| public | none | GET /health |
| reader | the control-plane key, or a tenant key from CR_TENANT_KEYS |
POST /librechat/retrieve, /librechat/compare, /librechat/explain; GET /librechat/image, /librechat/policy; GET /v1/models; POST /v1/chat/completions |
| admin | the control-plane key | every other route: /, /overview, /modules, /status, /api/fleet, /notify/status, /m/*, /up, /down, /approvals (read and decide), /dispatch, /jobs/*, /agent/*, /vibex/*, /librechat/ingest, /librechat/judge, /librechat/feedback, /librechat/chat |
- Tenant keys.
CR_TENANT_KEYS="key1=tenantA,tenantB;key2=*"binds a credential to corpus tenants. A tenant key is accepted onreaderroutes only, for the tenants it is bound to (403for others); it never opens anadminroute. The control-plane key is accepted onreaderroutes too; for choosing a tenant it counts as any credential that is not listed inCR_TENANT_KEYSand so reaches the default tenant only, unless it is also listed there (for exampleADMIN_KEY=*) orCR_ALLOW_ANONYMOUS_TENANTS=1lets every authenticated caller use every tenant. That flag never lets a caller without a credential in. With only tenant keys configured,adminroutes answer503. - Ingestion.
POST /librechat/ingestindexes only a directory insideCONTEXT_RUNTIME_CORPUS_ROOT. Name it with{"corpus": "<directory under the root>"}(older clients may send{"path": "<path relative to the root>"}). With no root configured, ingestion is disabled (503). Absolute paths,.., hidden names, backslashes,%and control characters are refused (400), and so is a directory that resolves outside the root or a corpus that contains a symlink (file or directory) pointing outside itself (404, the same answer as for a missing corpus). - Documentation routes.
/docs,/redocand/openapi.jsonare not served. - Browsers. The dashboards cannot send a header on their own; put the control plane behind a proxy or client that adds the credential. A
read-only public front end can sit behind a proxy that forwards only the
readerroutes and adds a tenant key (seedeploy/proxmox-demo/Caddyfile;tests/test_demo_proxy.pyruns it against the control plane with Caddy). The proxy must never hold the control-plane key. - Bind the service to a trusted network or to
127.0.0.1as well; the credential is not a substitute for network placement.