/

CVE-2026-45288

Severity:

CRITICAL RISK

(9.8)

SQL Injection in Marten Full-Text Search APIs

CVE-2026-45288

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution / Database Compromise

Severity:

CRITICAL RISK

(9.8)

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

Marten's full-text search APIs previously interpolated the user-controlled regConfig parameter directly into SQL queries without parameterization or validation.

When application code passes untrusted input into regConfig, this behavior can allow attackers to inject arbitrary SQL into PostgreSQL queries, leading to data compromise or full database takeover.

Affected context

The vulnerability exists in applications using Marten's full-text search capabilities where the regConfig argument is influenced by untrusted data (such as HTTP query parameters, request bodies, or user preferences).

Any code path that forwards user-controllable values into regConfig without strict whitelisting or transformation effectively creates a SQL injection sink.

The issue is scoped to environments where Marten constructs SQL for PostgreSQL full-text search using string interpolation for the configuration parameter rather than safe parameter binding.

Exploit preconditions

  • Attack surface: Application endpoints or services that invoke Marten full-text search APIs and expose regConfig or a derived value to callers.
  • Required access: Ability to supply or influence input that is eventually passed to Marten's full-text search regConfig parameter (typically unauthenticated or low-privilege web/API access).
  • Trigger point: Execution of a full-text search query where regConfig is concatenated into the SQL statement rather than parameterized.
  • Why exploitation is possible: The regConfig value is embedded directly into SQL as part of the full-text search configuration, so malicious content can escape its intended context and alter the structure of the query.

Why this happens

The root cause is a failure to treat the regConfig parameter as untrusted data when constructing SQL for PostgreSQL full-text search.

Instead of using parameterized queries or a constrained mapping of symbolic configuration names to safe SQL fragments, Marten interpolated regConfig directly into the query string.

This pattern matches CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where attacker-controlled data is concatenated into SQL without proper encoding, parameterization, or strict validation.

Potential impact

  • Arbitrary modification of database contents (INSERT, UPDATE, DELETE)
  • Unauthorized reading of sensitive data across tables and schemas
  • Bypassing application-level authorization by manipulating WHERE clauses
  • Creation or alteration of database roles, functions, or extensions (subject to DB permissions)
  • Destruction of data integrity or availability through crafted SQL payloads
  • Potential pivot to underlying host or other services via database-level features and misconfigurations

General mitigation guidance

Effective mitigation focuses on eliminating string concatenation for SQL construction and narrowing trust around configuration-like inputs:

  • Treat all full-text search inputs, including regConfig, as untrusted and pass them through parameterized query APIs, not string interpolation.
  • Restrict regConfig to a fixed set of known-safe values (e.g., enum or configuration mapping) and resolve them server-side rather than accepting arbitrary strings from clients.
  • Centralize full-text search query building in a small, well-reviewed module where safe patterns can be consistently enforced.
  • Apply the principle of least privilege to the database user used by Marten, limiting its ability to perform schema changes or other high-impact operations.
  • Use defense-in-depth validation at the application boundary so that unexpected characters or structures in configuration parameters are rejected early.

How teams detect issues like this

Detection can combine code-centric and runtime approaches:

  • Static analysis: Search for usages of Marten full-text APIs where regConfig is derived from request data or other untrusted sources; flag any string concatenation into SQL-building routines.
  • Code review: Examine query construction layers to ensure all parameters, including configuration values, use parameterization or whitelisted mappings rather than direct interpolation.
  • Security linters and SAST tools: Configure rules that detect SQL concatenation patterns and flag dynamic construction around full-text search or configuration parameters.
  • Runtime monitoring: Enable database logging for slow or error-prone queries and analyze for unusual patterns (e.g., stacked queries, tautological predicates) that may indicate SQL injection attempts.

Sources

SourceLink
github.comgithub.com/JasperFx/marten/commit/626249656829860b9c55895b5b6046b61a2a695f
github.comgithub.com/JasperFx/marten/pull/4343
github.comgithub.com/JasperFx/marten/security/advisories/GHSA-vmw2-qwm8-x84c

Frequently asked

questions

Yes, it can be remotely exploitable whenever a remote caller can influence the regConfig parameter (directly or indirectly) through application inputs that reach Marten's full-text search APIs.

Typically, only the level of access required to submit requests to an endpoint that uses full-text search with user-influenced regConfig. This may be unauthenticated or low-privilege access, depending on the application design.

Refactor code so that regConfig is never passed to Marten from arbitrary user input. Instead, map user-selectable options to a small, server-side enum or configuration, and ensure all query construction uses parameterized APIs rather than string interpolation.

Standardize on parameterized queries across the codebase, avoid building SQL strings directly from user input, perform strict input validation and whitelisting for configuration-like parameters, and integrate static analysis or secure coding checks into CI to flag unsafe query construction patterns early.

Find out what's already
exploitable in your codebase.