Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Lifecycle Timeline
3DescriptionGitHub Advisory
Summary
Marten's full-text search APIs interpolated the user-supplied regConfig parameter directly into the generated SQL without parameterization or validation, making every code path that exposes regConfig to untrusted input a SQL injection sink.
Affected APIs
IQuerySession.SearchAsync<T>(string searchTerm, string regConfig, ...)IQuerySession.PlainTextSearchAsync<T>(...)IQuerySession.PhraseSearchAsync<T>(...)IQuerySession.WebStyleSearchAsync<T>(...)IQuerySession.PrefixSearchAsync<T>(...)IQueryable<T>.Where(x => x.Search(term, regConfig))and the matchingPlainTextSearch/PhraseSearch/WebStyleSearch/PrefixSearchextension methods
Details
In the affected versions, FullTextWhereFragment renders the WHERE-clause SQL by string interpolation:
private string Sql =>
$"to_tsvector('{_regConfig}'::regconfig, {_dataConfig}) @@ {_searchFunction}('{_regConfig}'::regconfig, ?)";_regConfig arrives unchanged from the public API surface above. Any value containing a single quote terminates the SQL literal and lets an attacker append arbitrary PostgreSQL.
Confirmed exploit shapes (with regConfig set to attacker-controlled input)
| Goal | Payload |
|---|---|
| Time-based blind | english'::text); SELECT pg_sleep(5); -- |
| Information disclosure | english'; SELECT version(); -- |
| DDL execution | english'; DROP TABLE mt_doc_article; -- |
All five overloads listed above produced SQL containing the verbatim payload.
Impact
- Confidentiality: an attacker can append arbitrary
SELECTstatements and exfiltrate database contents through error channels, response timing, or - if the application surfaces query results - directly. - Integrity / Availability: DDL,
UPDATE,DELETE, andpg_sleep-style denial-of-service payloads succeed under the same vector. Concrete impact depends on the database role used by the Marten connection string. - Precondition: the calling application must forward attacker-controlled input into the
regConfigparameter (e.g. a?lang=query string mapped toregConfig). Applications that hard-coderegConfigto a compile-time constant are not exploitable.
Patches
Fixed in Marten 8.36.1 (and forward) by #4343.
FullTextWhereFragment now validates regConfig against ^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)?$ (a simple PostgreSQL identifier, optionally schema-qualified, capped at NAMEDATALEN-1 per side) and throws ArgumentException for anything else. The default value ("english"), schema-qualified configs ("pg_catalog.english"), and the standard PostgreSQL text-search configurations all continue to work.
Workarounds
If users cannot upgrade immediately, do one of the following at the application boundary:
- Hard-code
regConfigto a compile-time constant ("english","simple", …) and never accept it from request input. - Validate any externally-sourced
regConfigvalue before passing it to Marten - e.g. against the same regex as the patch (^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)?$) or against an allowlist of PostgreSQL configurations the application actually uses. - Drop the
regConfigargument from the call site so Marten falls back to the safe default.
Resources
- Patch PR: JasperFx/marten#4343
- Patched file:
FullTextWhereFragment.cs - Regression tests:
full_text_regconfig_sql_injection.cs - CWE-89: <https://cwe.mitre.org/data/definitions/89.html>
Credit
Reported privately to the JasperFx team with a working proof of concept covering all five affected overloads.
AnalysisAI
SQL injection in Marten's PostgreSQL full-text search APIs allows remote unauthenticated attackers to execute arbitrary database commands when applications pass user-controlled input to the regConfig parameter. The vulnerability affects all five search method overloads (SearchAsync, PlainTextSearchAsync, PhraseSearchAsync, WebStyleSearchAsync, PrefixSearchAsync) where the regConfig parameter is interpolated directly into SQL without validation. Confirmed exploit payloads demonstrate time-based blind extraction, information disclosure via SELECT statements, and DDL execution including table drops. Vendor-released patch available in Marten 8.37.0 via GitHub PR #4343. No public exploit identified at time of analysis, though the advisory includes working proof-of-concept payloads for all affected methods.
Technical ContextAI
Marten is a .NET document database library for PostgreSQL, treating the database as both a document store and queryable database. The vulnerability resides in the FullTextWhereFragment class which generates SQL WHERE clauses for PostgreSQL full-text search operations using the to_tsvector and regconfig type-casting. The affected code uses C
string interpolation ($"to_tsvector('{_regConfig}'::regconfig...") rather than parameterized queries, violating CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component). PostgreSQL's regconfig type accepts configuration names stored as identifiers in pg_ts_config, which should be validated against NAMEDATALEN constraints. The NuGet package identifier is pkg:nuget/marten, affecting all versions ≤ 8.36. The fix introduces regex validation (^[a-zA-Z_][a-zA-Z0-9_]*(\.\[a-zA-Z_][a-zA-Z0-9_]*)?$) limiting regConfig to simple or schema-qualified PostgreSQL identifiers, preventing single-quote injection.
RemediationAI
Upgrade to Marten 8.37.0 or later, which implements regex-based validation of the regConfig parameter via PR #4343 (https://github.com/JasperFx/marten/pull/4343, commit 626249656829860b9c55895b5b6046b61a2a695f). The patch rejects any regConfig value not matching ^[a-zA-Z_][a-zA-Z0-9_]*(\.\[a-zA-Z_][a-zA-Z0-9_]*)?$ and throws ArgumentException, allowing only simple or schema-qualified PostgreSQL identifiers while preserving support for standard configurations like 'english', 'simple', or 'pg_catalog.english'. If immediate upgrade is not feasible, apply one of these workarounds at the application boundary: (1) Hard-code regConfig to a compile-time constant ('english', 'simple', etc.) and never accept it from HTTP requests, query strings, or other external sources. (2) Validate externally-sourced regConfig values against the same regex pattern or a strict allowlist of known-safe PostgreSQL text-search configurations before passing to Marten APIs. (3) Remove the regConfig argument from call sites entirely, allowing Marten to use its safe default value. The workarounds prevent exploitation but limit runtime flexibility; option 2 preserves legitimate multi-language support with minimal security trade-off. Note that the advisory warns against partial mitigations like escaping single quotes-proper validation or upgrade is required.
More in PostgreSQL
View allPostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re
Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.
PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow
The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t
A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra
In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve
## Summary An unauthenticated SQL injection vulnerability exists in the Vendure Shop API. A user-controlled query strin
Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot
Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al
A vulnerability in the FinanceChatLlamaPack of the run-llama/llama_index repository, versions up to v0.12.3, allows for
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-33022
GHSA-vmw2-qwm8-x84c