GHSA-RHM7-C77Q-G5CQ
Cross-tenant data-query execution via app-runtime run path (POST /api/data-queries/:id/run) — missing org/datasource authorization
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-RHM7-C77Q-G5CQ divulgada · CVSS 6.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
The authenticated app-runtime endpoint `POST /api/data-queries/:id/run` resolves the target app by data-query id with no organization scoping (`QueryAuthGuard` calls `appRepository.findByDataQuery(id)` with no organizationId, query-auth.guard.ts#L32), and its only authorization gate `AppFeatureAbilityGuard` builds a casl ability whose End User catch-all branch grants `RUN_VIEWER` on every `App` instance with no app-id and no organization condition (data-query-app.ability.ts#L90-93). Any authenticated non-admin/non-builder user ("End User") of any organization can therefore execute the pre-defined data queries of any app in any OTHER organization, run them against that app's datasource with the datasource's full server-side-decrypted credentials, and receive the results.
This is the query-execution analog of the already-accepted advisory GHSA-x7qj-hfg8-p4cw (cross-tenant credential decryption via POST /api/data-sources/decrypt missing org scoping). The boundary is one ToolJet otherwise enforces: the builder run path `runQueryOnBuilder` (controller.ts#L104-134) carries `ValidateQueryAppGuard` (which scopes the app lookup to `user.organizationId`, validate-query-app.guard.ts#L40) AND `DataSourceFeatureAbilityGuard`; the direct datasource routes carry `ValidateDataSourceGuard`. The app-runtime run path drops both.
Execution: `runQueryForApp` (service.ts#L278) -> `runAndGetResult` (mode view, env undefined) -> `DataQueryUtilService.runQuery` -> `appEnvironmentUtilService.getOptions(dataSource.id, organizationId, undefined)` resolves the default-environment decrypted datasource credentials for the query's org and executes the stored query, returning results. No per-user datasource permission, no app-membership, and no released-version restriction is applied.
Impact: cross-tenant confidentiality breach (read any other org's datasource query results) plus within-tenant horizontal escalation (run apps never shared to the End User). The query body is builder-defined (not arbitrary SQL), but attacker-supplied `resolvedOptions` runtime params shape parameterized REST/GraphQL/SQL queries and results return verbatim.
Affected version: <= v3.20.181-lts (the current latest release as of 2026-06-17; both query-auth.guard.ts and data-query-app.ability.ts are byte-identical at v3.20.181-lts and v3.20.169-lts, confirming the 3.20.178 org-scoping fix for GHSA-x7qj-hfg8-p4cw covered only POST /api/data-sources/decrypt and did NOT sweep this data-queries run path).
Remediation: (1) resolve the app with `findByDataQuery(id, user.organizationId)` in QueryAuthGuard and reject org mismatch (mirror ValidateQueryAppGuard); (2) constrain the End User `RUN_VIEWER` rule to `viewableAppsId`/released apps via a casl condition; (3) re-introduce a datasource ability check on the app-runtime path for non-public apps.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmtooljet |
Sin parche | — | — | 0.0.1-security.1 afectada |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/ToolJet/ToolJet/security/advisories/GHSA-rhm7-c77q-g5cqLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
