Vulnerability GHSA-vmw2-qwm8-x84c

Critical
CRITICAL RISK
CVSS Score: 9.8
Score Range: 9.0–10.0
Critical severity vulnerabilities (CVSS 9.0–10.0). These represent the highest impact issues.
5 months ago
May 14, 2026 at 08:46 PM UTC
Marten has an injection vulnerability in its full-text search regConfig parameter
0.5.0.8 and 0.5.0.9 and 0.5.1.34 and 0.5.2.36 and 0.5.3.38 and 0.6.0.43 and 0.6.1.46 and 0.6.2.57 and 0.6.3.67 and 0.6.4.77 and 0.6.5.78 and 0.6.6.82 and 0.7.0.85 and 0.7.0.97 and 0.7.1.103 and 0.8.0.132 and 0.8.2.188 and 0.8.3.238 and 0.8.4.255 and 0.8.5.274 and 0.8.6.284 and 0.8.7.297 and 0.8.8.299 and 0.8.9.322 and 0.8.10.355 and 0.9.0.379 and 0.9.1.401 and 0.9.2.423 and 0.9.2.427 and 0.9.3.458 and 0.9.4.464 and 0.9.5.473 and 0.9.6.493 and 0.9.6.498 and 0.9.7.515 and 0.9.7.517 and 0.9.8.523 and 0.9.9.534 and 0.9.9.551 and 0.9.10.555 and 0.9.11.556 and 0.9.12.563 and 1.0.0-alpha-625 and 1.0.0-alpha-639 and 1.0.0-alpha-644 and 1.0.0-alpha-663 and 1.0.0-alpha-664 and 1.0.0-alpha-666 and 1.0.0-alpha-667 and 1.0.0-alpha-668 and 1.0.0-alpha-669 and 1.0.0-alpha-701 and 1.0.0-alpha-703 and 1.0.0-alpha-706 and 1.0.0-alpha-709 and 1.0.0-alpha-710 and 1.0.0-alpha-719 and 1.0.0 - 2.0.0-alpha-50651 and 2.0.0-alpha-51133 and 2.0.0-alpha-51614 and 2.0.0-rc-50930 and 2.0.0-rc-51247 and 2.0.0 - 3.0.0-alpha-1 and 3.0.0-alpha-2 and 3.0.0 - 4.0.0-alpha and 4.0.0 - 5.11.0 and 6.0.3 - 7.39.3 and 7.39.5 - 8.0.0-alpha-2 and 8.0.0-alpha-3 and 8.0.0-alpha-5 and 8.0.0-alpha-6- and 8.0.0-beta-1 and 8.0.0-beta-2 and 8.0.0-rc-1 and 8.0.0-rc-2 and 8.0.0 - 8.1.0 and 8.1.2 - 8.9.0-channels-alpha-1 and 8.9.0-channels-alpha-2 and 8.9.0 - 8.36.0
0.5.0.8 and 0.5.0.9 and 0.5.1.34 and 0.5.2.36 and 0.5.3.38 and 0.6.0.43 and 0.6.1.46 and 0.6.2.57 and 0.6.3.67 and 0.6.4.77 and 0.6.5.78 and 0.6.6.82 and 0.7.0.85 and 0.7.0.97 and 0.7.1.103 and 0.8.0.132 and 0.8.2.188 and 0.8.3.238 and 0.8.4.255 and 0.8.5.274 and 0.8.6.284 and 0.8.7.297 and 0.8.8.299 and 0.8.9.322 and 0.8.10.355 and 0.9.0.379 and 0.9.1.401 and 0.9.2.423 and 0.9.2.427 and 0.9.3.458 and 0.9.4.464 and 0.9.5.473 and 0.9.6.493 and 0.9.6.498 and 0.9.7.515 and 0.9.7.517 and 0.9.8.523 and 0.9.9.534 and 0.9.9.551 and 0.9.10.555 and 0.9.11.556 and 0.9.12.563 and 1.0.0-alpha-625 and 1.0.0-alpha-639 and 1.0.0-alpha-644 and 1.0.0-alpha-663 and 1.0.0-alpha-664 and 1.0.0-alpha-666 and 1.0.0-alpha-667 and 1.0.0-alpha-668 and 1.0.0-alpha-669 and 1.0.0-alpha-701 and 1.0.0-alpha-703 and 1.0.0-alpha-706 and 1.0.0-alpha-709 and 1.0.0-alpha-710 and 1.0.0-alpha-719 and 1.0.0 - 2.0.0-alpha-50651 and 2.0.0-alpha-51133 and 2.0.0-alpha-51614 and 2.0.0-rc-50930 and 2.0.0-rc-51247 and 2.0.0 - 3.0.0-alpha-1 and 3.0.0-alpha-2 and 3.0.0 - 4.0.0-alpha and 4.0.0 - 5.11.0 and 6.0.3 - 7.39.3 and 7.39.5 - 8.0.0-alpha-2 and 8.0.0-alpha-3 and 8.0.0-alpha-5 and 8.0.0-alpha-6- and 8.0.0-beta-1 and 8.0.0-beta-2 and 8.0.0-rc-1 and 8.0.0-rc-2 and 8.0.0 - 8.1.0 and 8.1.2 - 8.9.0-channels-alpha-1 and 8.9.0-channels-alpha-2 and 8.9.0 - 8.36.0

Summary

Marten has an injection vulnerability in its full-text search regConfig parameter

Details

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 matching PlainTextSearch / PhraseSearch / WebStyleSearch / PrefixSearch extension 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 SELECT statements and exfiltrate database contents through error channels, response timing, or — if the application surfaces query results — directly.
  • Integrity / Availability: DDL, UPDATE, DELETE, and pg_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 regConfig parameter (e.g. a ?lang= query string mapped to regConfig). Applications that hard-code regConfig to 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:

  1. Hard-code regConfig to a compile-time constant ("english", "simple", …) and never accept it from request input.
  2. Validate any externally-sourced regConfig value 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.
  3. Drop the regConfig argument from the call site so Marten falls back to the safe default.

Resources

Credit

Reported privately to the JasperFx team with a working proof of concept covering all five affected overloads.

Impacted packages

Timeline

Published
5 months ago
May 14, 2026 at 08:46 PM UTC
Fixed (8.37.0)
6 months ago
May 09, 2026 at 09:51 PM UTC
Last Modified
5 months ago
June 09, 2026 at 10:30 AM UTC