A server-side request forgery (CWE-918) in the datasource test-connection endpoint. The datasource kind, plugin id and connection options are all taken from the request BODY with no SSRF validation, and the TEST_CONNECTION ability is granted broadly. Any user with that ability can make the server connect to arbitrary hosts and ports - including loopback, internal network services, and cloud metadata endpoints - through any of a dozen unguarded plugins (influxdb, couchdb, elasticsearch, typesense, clickhouse, appwrite, woocommerce, cosmosdb, minio, azureblobstorage, smtp, grpcv2).
server/src/modules/data-sources/controller.ts (:133-138) → server/src/modules/data-sources/util.service.ts testConnection() (lines 799-861). The handler reads kind / options / plugin_id from the request body and passes attacker-supplied options straight to the selected plugin's testConnection() with no URL/host validation:
TestDataSourceDto extends CreateDataSourceDto ( dto/index.ts:31-36 ); options is only @IsDefined() . The plugins' testConnection() implementations call raw got() /SDK clients on the supplied host with no validateUrlForSSRF (e.g. influxdb plugins/packages/influxdb/lib/index.ts:149-151 → got(\ ${protocol}://${host}:${port}/influxdb/cloud/api//ping`)`).
Body-controlled test-connection SSRF
Files: server/src/modules/data-sources/controller.ts (:133-138), server/src/modules/data-sources/util.service.ts (:799-861), server/src/modules/data-sources/dto/index.ts (:31-36)
kind / plugin_id / options come from the request body with no SSRF validation.
TEST_CONNECTION is granted to admins, datasource creators, and users with isAllEditable / isAllViewable / configurableDataSourceId / usableDataSourcesId (ability/index.ts:60-61,79-80,102-103,119-120,133-134,147-148).
The datasource id only needs to exist in the org (ValidateDataSourceGuard); it does not need to match the chosen kind.
Trigger (any user with TEST_CONNECTION ability):
Preconditions: authenticated user with the TEST_CONNECTION ability and any datasource id from the org.
Obtain any datasource id of the org (e.g. the default tooljetdbdefault or a sample datasource).
Choose a plugin whose testConnection makes an HTTP request (influxdb, elasticsearch, couchdb, ...) and set host to the internal/metadata target.
The server performs the request server-side; on real cloud deployments the metadata endpoint returns IAM credentials.
Type: server-side request forgery (CWE-918).
Who is impacted: self-hosted ToolJet instances (any user with the TEST_CONNECTION ability - a broad set including datasource users).
Impact: SSRF to loopback, internal services, and cloud metadata (169.254.169.254 IAM credentials); internal network/port scanning; blind interaction with any internal HTTP/SMTP/gRPC service. No SSRF protection exists on this path even where the protected run() paths are configured.
