/

CVE-2026-86123

Severity:

HIGH RISK

(8.7)

SSRF (CWE-918) in SQL Chat Unauthenticated API Endpoints

CVE-2026-86123

Deferred

Vulnerability type

Category:

Server-Side Request Forgery

CWE:

CWE-918

Impact:

Unauthorized Database Access and Internal Network Pivoting

Severity:

HIGH RISK

(8.7)

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

SQL Chat exposes unauthenticated API endpoints that accept client-supplied database connection details and execute SQL against attacker-selected hosts. An attacker may use these endpoints to access internal databases, run unauthorized queries, enumerate schemas, and pivot into reachable network services.

Affected context

The vulnerability occurs in SQL Chat deployments where API endpoints are reachable without authentication and permit callers to provide database connection parameters. Risk is increased when the server can reach internal database services or other protected network locations and the application does not enforce destination, protocol, query, or privilege restrictions.

Exploit preconditions

  • Attack surface: Publicly or internally reachable SQL Chat API endpoints
  • Required access: No authentication, assuming the affected endpoints are exposed
  • Trigger point: An API request containing attacker-controlled database connection parameters and SQL content
  • Why exploitation is possible: The server initiates outbound database connections and executes supplied queries without adequately restricting destinations, credentials, or query authority

Why this happens

The underlying issue is a server-side request forgery pattern in which application-controlled network requests are created from attacker-supplied connection parameters. Because the API also permits arbitrary SQL execution, the SSRF behavior can expose database functionality and internal network reachability rather than merely retrieving a remote resource. This maps to CWE-918: Server-Side Request Forgery, where a server is induced to connect to attacker-selected or otherwise unauthorized destinations.

Potential impact

  • Attackers may access databases that are reachable from the SQL Chat server
  • Unauthorized SQL commands may alter, delete, or disclose data
  • Database schemas and metadata may be enumerated
  • Internal services may be probed through supported database connection mechanisms
  • Compromised database credentials or trust relationships could enable further access
  • The application may be used as a pivot into protected network segments

General mitigation guidance

Mitigation generally focuses on removing unauthenticated database execution capabilities and reducing trust in client-supplied connection settings.

Common defensive patterns include:

  • Require strong authentication and authorization for every database-connection and query endpoint
  • Prefer server-side connection profiles over arbitrary client-supplied hosts, ports, credentials, and protocols
  • Enforce explicit destination allowlists and block private, loopback, link-local, and metadata network ranges where appropriate
  • Restrict supported database drivers and outbound protocols to an approved set
  • Apply query validation, operation-level controls, and least-privilege database identities
  • Separate administrative database access from general application functionality
  • Use network segmentation and egress filtering to limit reachable internal services
  • Avoid returning unnecessary database errors, metadata, or query results to untrusted callers

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis of endpoints that construct outbound connections from request parameters
  • Code review signals such as client-controlled host, port, driver, credential, or connection-string fields
  • API inventory reviews identifying unauthenticated routes that execute database operations
  • Network monitoring for unexpected database connections from the SQL Chat service
  • Detection of requests targeting private, loopback, link-local, or otherwise prohibited address ranges
  • Policy enforcement requiring authentication, destination allowlists, egress controls, and least-privilege database roles
  • Automated security review tools that flag SSRF-prone URL or connection handling patterns

Sources

SourceLink
github.comgithub.com/sqlchat/sqlchat
github.comgithub.com/sqlchat/sqlchat/blob/665af875413affadfeefff81794f1d7758782bc2/src/pages/api/connection/execute.ts
github.comgithub.com/sqlchat/sqlchat/blob/665af875413affadfeefff81794f1d7758782bc2/src/pages/api/connection/test.ts
github.comgithub.com/sqlchat/sqlchat/issues/189
vulncheck.comvulncheck.com/advisories/sql-chat-unauthenticated-database-connection-proxy-in-the-api-connection-endpoints

Frequently asked

questions

Yes, when the affected API endpoints are network-reachable and remain unauthenticated. Exploitation does not require a separate account if the endpoints accept requests from the attacker.

The attacker generally needs only network access to an exposed SQL Chat API endpoint. The server's network position and database connectivity determine which destinations may be reachable.

Require authentication and authorization, remove arbitrary client-controlled connection targets, use approved server-side connection profiles, and restrict outbound destinations and database privileges.

Treat all client-supplied connection parameters as untrusted, enforce destination allowlists and egress policies, review unauthenticated routes, and monitor unusual outbound database activity.

Find out what's already
exploitable in your codebase.