CVE-2026-45288: Marten Marten Has An Injection Vulnerability Vulnerability

CRITICAL
Advisory Identifier: GHSA-vmw2-qwm8-x84c
CVSS 9.8
CWE-89 CWE-74
Published
Advisory Summary

CVE-2026-45288 is a CRITICAL (CVSS 9.8) marten has an injection vulnerability vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Marten libraries in the NuGet ecosystem. The issue involves marten has an injection vulnerability in its full-text search regconfig parameter. Remediation is available by upgrading affected packages to version 8.37.0.

CVE-2026-45288 at a Glance

CVE Identifier CVE-2026-45288
GHSA Identifier GHSA-vmw2-qwm8-x84c
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Marten
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-45288

To remediate this vulnerability, upgrade all affected Marten dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

Marten fixed: 8.37.0
Upgrade Marten to 8.37.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for Marten

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-45288, inspect your project dependencies for Marten:

inspect dependencies for Marten

Analyze the terminal output to locate any version of Marten in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.37.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Marten, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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`](https://github.com/JasperFx/marten/blob/master/src/Marten/Linq/SqlGeneration/Filters/FullTextWhereFragment.cs) renders the WHERE-clause SQL by string interpolation: ```csharp 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](https://github.com/JasperFx/marten/pull/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 - Patch PR: [JasperFx/marten#4343](https://github.com/JasperFx/marten/pull/4343) - Patched file: [`FullTextWhereFragment.cs`](https://github.com/JasperFx/marten/blob/master/src/Marten/Linq/SqlGeneration/Filters/FullTextWhereFragment.cs) - Regression tests: [`full_text_regconfig_sql_injection.cs`](https://github.com/JasperFx/marten/blob/master/src/LinqTests/Bugs/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.

CVE-2026-45288 Affected Marten Versions

1 component(s)
Fixed Versions:
8.37.0
Product / Package Ecosystem Affected Versions Fixed Version
Marten
NuGet
< 8.37.0
8.37.0

References

Frequently Asked Questions

What is CVE-2026-45288?
CVE-2026-45288 is a security vulnerability in Marten involving Marten has an injection vulnerability in its full-text search regConfig parameter under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Marten versions are affected?
Affected versions include releases prior to 8.37.0 across affected packages: Marten.
What version fixes CVE-2026-45288?
Upgrading to 8.37.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Marten affected?
Yes, Marten is affected in releases prior to 8.37.0. Upgrade your dependency to 8.37.0 or later.
What is the CVSS score of CVE-2026-45288?
CVE-2026-45288 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-45288?
CVE-2026-45288 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check NuGet dependencies for CVE-2026-45288?
Run the dependency tree command: 'inspect dependencies for Marten'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vmw2-qwm8-x84c",
  "modified" : "2026-06-09T10:24:28Z",
  "published" : "2026-05-14T20:46:26Z",
  "aliases" : [ "CVE-2026-45288" ],
  "summary" : "Marten has an injection vulnerability in its full-text search regConfig parameter",
  "details" : "## Summary\n\nMarten'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.\n\n## Affected APIs\n\n- `IQuerySession.SearchAsync<T>(string searchTerm, string regConfig, ...)`\n- `IQuerySession.PlainTextSearchAsync<T>(...)`\n- `IQuerySession.PhraseSearchAsync<T>(...)`\n- `IQuerySession.WebStyleSearchAsync<T>(...)`\n- `IQuerySession.PrefixSearchAsync<T>(...)`\n- `IQueryable<T>.Where(x => x.Search(term, regConfig))` and the matching `PlainTextSearch` / `PhraseSearch` / `WebStyleSearch` / `PrefixSearch` extension methods\n\n## Details\n\nIn the affected versions, [`FullTextWhereFragment`](https://github.com/JasperFx/marten/blob/master/src/Marten/Linq/SqlGeneration/Filters/FullTextWhereFragment.cs) renders the WHERE-clause SQL by string interpolation:\n\n```csharp\nprivate string Sql =>\n    $\"to_tsvector('{_regConfig}'::regconfig, {_dataConfig}) @@ {_searchFunction}('{_regConfig}'::regconfig, ?)\";\n```\n\n`_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.\n\n### Confirmed exploit shapes (with `regConfig` set to attacker-controlled input)\n\n| Goal | Payload |\n| --- | --- |\n| Time-based blind | `english'::text); SELECT pg_sleep(5); --` |\n| Information disclosure | `english'; SELECT version(); --` |\n| DDL execution | `english'; DROP TABLE mt_doc_article; --` |\n\nAll five overloads listed above produced SQL containing the verbatim payload.\n\n## Impact\n\n- **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.\n- **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.\n- **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.\n\n## Patches\n\nFixed in **Marten 8.36.1** (and forward) by [#4343](https://github.com/JasperFx/marten/pull/4343).\n\n`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.\n\n## Workarounds\n\nIf users cannot upgrade immediately, do **one** of the following at the application boundary:\n\n1. Hard-code `regConfig` to a compile-time constant (`\"english\"`, `\"simple\"`, …) and never accept it from request input.\n2. 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.\n3. Drop the `regConfig` argument from the call site so Marten falls back to the safe default.\n\n## Resources\n\n- Patch PR: [JasperFx/marten#4343](https://github.com/JasperFx/marten/pull/4343)\n- Patched file: [`FullTextWhereFragment.cs`](https://github.com/JasperFx/marten/blob/master/src/Marten/Linq/SqlGeneration/Filters/FullTextWhereFragment.cs)\n- Regression tests: [`full_text_regconfig_sql_injection.cs`](https://github.com/JasperFx/marten/blob/master/src/LinqTests/Bugs/full_text_regconfig_sql_injection.cs)\n- CWE-89: <https://cwe.mitre.org/data/definitions/89.html>\n\n## Credit\n\nReported privately to the JasperFx team with a working proof of concept covering all five affected overloads.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Marten"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.37.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 8.36"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/JasperFx/marten/security/advisories/GHSA-vmw2-qwm8-x84c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45288"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JasperFx/marten/pull/4343"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JasperFx/marten/commit/626249656829860b9c55895b5b6046b61a2a695f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/JasperFx/marten"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74", "CWE-89" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-14T20:46:26Z",
    "nvd_published_at" : "2026-05-28T21:16:31Z"
  }
}