/

CVE-2026-32949

Severity:

HIGH RISK

(7.5)

Server-Side Request Forgery (SSRF) and Improper File Access

CVE-2026-32949

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF) and Improper File Access

CWE:

CWE-73, CWE-918

Impact:

Arbitrary File Read and Sensitive Data Exposure via SSRF

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SQLBot versions prior to 1.7.0 contain a Server-Side Request Forgery (SSRF) flaw in the datasource connectivity check that can be abused to read arbitrary files from the server.

By configuring a forged MySQL data source and leveraging the LOCAL INFILE capability via a rogue MySQL server, an attacker can trick SQLBot into loading and exfiltrating system or application files such as /etc/passwd and sensitive configuration data.

Affected context

This vulnerability appears in SQLBot deployments that:

  • Allow users to create or modify external data sources through the /api/v1/datasource/check API.
  • Permit outbound connections from the SQLBot server to attacker-controlled MySQL endpoints.
  • Do not restrict or sanitize MySQL connection parameters (e.g., extraJdbc) that enable LOAD DATA LOCAL INFILE.

The risk is elevated in environments where SQLBot runs with permissions to read system files or application configuration files containing secrets (database credentials, API keys, tokens).

Exploit preconditions

  • Attack surface: The /api/v1/datasource/check HTTP endpoint responsible for validating data source connectivity.
  • Required access: Ability to invoke the data source check API and supply connection parameters (e.g., authenticated user with permission to add or validate data sources, or any exposed integration using that API).
  • Network conditions: The SQLBot server must be able to initiate outbound MySQL connections to an attacker-controlled host and port.
  • Trigger point: During the MySQL handshake and subsequent connection verification, when the backend honors extraJdbc="local_infile=1" and processes LOAD DATA LOCAL INFILE commands.
  • Why exploitation is possible: The backend implicitly trusts the remote MySQL server, permits LOCAL INFILE operations, and runs with filesystem access broad enough to read arbitrary files whose paths are specified by the rogue server. Combined with SSRF-style control over the target MySQL endpoint, this leads to remote-triggered file reads from the SQLBot host.

Why this happens

The bug stems from combining unguarded outbound connectivity (SSRF) with insecure handling of database client capabilities that access local resources.

Concretely, the /api/v1/datasource/check logic allows user-controlled configuration of a MySQL data source, including parameters enabling local_infile. When the backend connects to the supplied host, it acts as a MySQL client and follows instructions from the remote server, including LOAD DATA LOCAL INFILE, which causes the client to read local files and send them over the connection.

This behavior maps to:

  • CWE-918 (Server-Side Request Forgery): The application performs network requests to attacker-specified endpoints (rogue MySQL server) without proper validation or restriction.
  • CWE-73 (External Control of File Name or Path): The external MySQL server can influence the file path used in LOAD DATA LOCAL INFILE, effectively controlling which local files are accessed. The system treats this external input as trusted when performing local file operations.

The insecure pattern is: a server-side connectivity check that accepts attacker-controlled endpoints and protocol options, then delegates powerful local operations (file access) to that external party without constraining what can be requested.

Potential impact

  • Exposure of sensitive system files (e.g., /etc/passwd, OS configuration).
  • Disclosure of application configuration files containing database credentials, API keys, and encryption secrets.
  • Leakage of source code or SQLBot internal logic, aiding further exploitation.
  • Facilitation of lateral movement if leaked credentials are reused across infrastructure.
  • Enhanced reconnaissance for attackers, including environment metadata and deployment details.

General mitigation guidance

Effective mitigation focuses on constraining both outbound connectivity and local file access paths triggered by external services:

  • Constrain SSRF capabilities:
  • Limit which hosts and ports the SQLBot server can reach for data source validation, using allowlists, service discovery, or explicit network policies.
  • Reject or tightly validate user-supplied hostnames, IP addresses, and connection strings to avoid arbitrary endpoints (including internal networks or loopback).
  • Disable or restrict LOCAL INFILE:
  • Configure MySQL client libraries such that LOAD DATA LOCAL INFILE is disabled by default, unless explicitly required and carefully controlled.
  • If local import is needed, restrict it to predefined directories or mapped paths and enforce strict filename and path validation.
  • Harden data source configuration handling:
  • Treat advanced parameters like extraJdbc as high-risk, disallowing or sanitizing options that affect local file access or client capabilities.
  • Introduce a schema or whitelist for allowed connection parameters that excludes file-related or arbitrary command options.
  • Reduce file system exposure:
  • Run SQLBot under a dedicated, minimally privileged account with limited read access, especially to system directories and secret-bearing files.
  • Isolate configuration secrets using environment variables, secret management systems, or dedicated secret volumes with restricted access, rather than world-readable files.
  • Apply defense-in-depth:
  • Enforce network-level egress controls so application servers cannot freely connect to arbitrary external databases.
  • Use container or OS-level sandboxing (e.g., chroot-like isolation, read-only file systems where practical) to reduce the blast radius of any file-read capability.

How teams detect issues like this

Detecting this class of vulnerability benefits from both code-centric and operational monitoring approaches:

  • Static analysis and code review:
  • Search for code paths where user-supplied connection parameters (host, port, extraJdbc, JDBC URLs) are passed directly into database clients used for connectivity checks.
  • Flag uses of MySQL client options enabling LOCAL INFILE or similar features that access local files, especially when options are constructed from user input.
  • Review any logic that performs network requests from servers on behalf of users (health checks, data source validators) for SSRF-like patterns and absence of host allowlists.
  • Policy and configuration enforcement:
  • Define security policies that disallow LOCAL INFILE in production clients unless explicitly justified.
  • Implement CI/CD checks that scan configuration and source for dangerous database options or unconstrained outbound validation endpoints.
  • Runtime monitoring and logging:
  • Enable detailed logging of outbound connections from SQLBot, including destination hosts and ports for data source checks.
  • Monitor database client logs for use of LOAD DATA LOCAL INFILE and investigate unusual or unexpected file paths.
  • Use network monitoring to detect connections from the application server to unapproved or external database hosts initiated by data source checks.
  • Automated security tooling:
  • Integrate SAST tools capable of identifying SSRF sinks (HTTP clients, DB clients) fed by user input.
  • Use DAST or integration tests that attempt to configure rogue data sources and verify that local file access operations are blocked.

Sources

SourceLink
github.comgithub.com/dataease/SQLBot/commit/ff98514827bad99b8fa4b39385adecc6e3d44355
github.comgithub.com/dataease/SQLBot/releases/tag/v1.7.0
github.comgithub.com/dataease/SQLBot/security/advisories/GHSA-wqj3-xcxf-j9m9

Frequently asked

questions

Exploitability depends on who can call the /api/v1/datasource/check endpoint and how freely they can define data source parameters. In deployments where regular users or integrations can create or validate external MySQL data sources, an attacker can typically exploit this remotely, provided the SQLBot server can reach attacker-controlled endpoints.

In most realistic setups, some level of authenticated access is required to configure a new data source or trigger the connectivity check API. However, if an instance exposes this endpoint without proper authorization, exploitation can become effectively unauthenticated. The key requirement is the ability to submit and test a crafted MySQL data source configuration.

The most robust fix is to disallow dangerous client capabilities like LOCAL INFILE during data source checks, strictly validate or whitelist connection options, and prevent the connectivity check from reaching arbitrary external hosts. Additionally, running SQLBot with minimal filesystem privileges significantly reduces the impact of any residual file access pathways.

Design connectivity and health-check features under the assumption that remote endpoints may be hostile: enforce outbound host allowlists, forbid file-affecting protocol options by default, and separate local resource access from externally influenced operations. Complement these design principles with automated checks for SSRF patterns and risky database options in code review and CI pipelines.

Find out what's already
exploitable in your codebase.