Quick Take
- What: pgEdge RAG Server leaked partial LLM provider API keys (OpenAI, Anthropic, Voyage, Gemini) through error messages returned by unauthenticated API endpoints
- Who is affected: Any deployment of pgEdge RAG Server version 1.0.0 or earlier (including all alpha and beta pre-releases) where the query or health endpoints were reachable by untrusted parties
- Severity: CVSS 5.8 (Medium), but the health endpoint required only a single GET request with no authentication to obtain key fragments
- Fixed version: 2.0.0, released September 3, 2026
- What to do: Upgrade to version 2.0.0 or later and rotate any LLM provider credentials that were configured on affected versions while endpoints were publicly accessible
In plain English
A security flaw in pgEdge RAG Server allowed anyone who could reach the server to see part of the secret API keys used to connect to AI services like OpenAI. When the server encountered an error from these AI providers, it would show the error message directly to whoever made the request, and those error messages often included a masked version of the API key (like showing the first few and last few characters). The worst part was that a simple health check request, which required no authentication at all, was enough to trigger this leak.
What you should do: If you run this server, you need to upgrade to version 2.0.0 and change your AI provider API keys, because the leaked fragments cannot be un-leaked.
What happened
The vulnerability existed in pgEdge RAG Server’s query API handler in internal/server/handlers.go. When LLM provider calls failed, the server returned the raw Go error string directly to API clients through err.Error(). These errors originated from the pgedge-go-llm-lib library, which wrapped upstream provider failures in ProviderError objects containing the provider’s JSON error response verbatim.
LLM providers including OpenAI, Anthropic, Voyage, and Gemini characteristically echo a truncated form of submitted API keys in error messages when they reject credentials. For example, OpenAI returns messages quoting the sk-proj- prefix and the final four characters of the submitted key. By relaying these error messages unchanged, pgEdge RAG Server disclosed fragments of the operator’s real provider credentials to unauthenticated callers.
The advisory identifies three disclosure paths:
- The query endpoint at POST /v1/query returned provider error text in non-streaming responses
- The streaming query endpoint returned provider error text in SSE error events
- The health endpoint at GET /v1/health was the most severe: it called pingProvider, which exercised the real configured key and returned err.Error() in the ProviderHealth.Error field serialized to the caller. A single unauthenticated GET request was sufficient to obtain the leaked fragment, requiring no query, no POST body, and nothing to guess.
The vulnerability affected version 1.0.0 and all earlier releases including alpha and beta versions. None of the affected endpoints required authentication.
What you should do
Upgrade to pgEdge RAG Server version 2.0.0 or later immediately. The sources state that upgrading alone does not undo the disclosure.
Rotate any LLM provider credential (OpenAI, Anthropic, Voyage, Gemini, or other configured providers) that was active on an affected version while the query or health endpoints were reachable by untrusted callers. This is particularly urgent if the provider was rejecting the key at the time, as authentication failures produced the most detailed disclosures. A fragment already disclosed remains disclosed even after rotation, but rotation prevents further abuse of the compromised credential.
If immediate upgrade is not possible, the advisory mentions workarounds: place the server behind a proxy that rewrites 5xx response bodies, or terminate provider errors before they reach the API surface. However, the sources emphasize that none of these workarounds removes the underlying defect and none substitutes for upgrading.
What it means
The fix in version 2.0.0 introduces a new internal/safeerr package that classifies errors rather than scrubbing them. The package derives short fixed descriptions from error sentinels using errors.Is, discarding upstream provider message text and status codes entirely. Nothing derived from a provider’s response body can reach API clients.
The commit message explains the design choice: “Scrubbing a string that might contain a secret is guesswork; declining to include it is not.” For unrecognized errors, the system returns a generic message rather than err.Error(), since unclassified errors may still wrap provider responses further down the error chain.
API clients now receive less detail in error messages, which is intentional. The API reference documents a fixed set of messages including the configured provider rejected the server’s credentials, the provider rate limit was exceeded; retry later, the provider rejected the request as invalid, and others. The documentation states this is “a security boundary rather than an oversight” because the query and health endpoints are unauthenticated.
Full error detail is still logged server-side with credential-shaped substrings redacted, covering OpenAI, Anthropic, Voyage and Gemini key shapes including masked forms, bearer tokens, and libpq password parameters. The sources note this pattern-matching redaction is best-effort defense in depth for logs, not the primary security boundary.
The CVSS score of 5.8 reflects Medium severity with Attack Vector Network, Attack Complexity Low, Privileges Required None, User Interaction None, Scope Changed, Confidentiality Low, and no Integrity or Availability impact. The Changed scope reflects that the disclosed credentials authenticate to third-party provider accounts rather than pgEdge software itself.



