Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-46373

CVE-2026-46373: SQLFluff Parser DoS Vulnerability

CVE-2026-46373 is a Denial of Service vulnerability in SQLFluff that allows attackers to exhaust resources through malicious queries with excessive nesting. This article covers technical details, affected versions, and patches.

Published:

CVE-2026-46373 Overview

CVE-2026-46373 is a denial of service vulnerability in SQLFluff, a modular SQL linter and auto-formatter with support for multiple dialects and templated code. The flaw affects all versions prior to 4.1.0. An untrusted user can submit a malicious SQL query containing deliberate excessive nesting to any application that exposes the SQLFluff parser. Parsing the crafted query triggers resource exhaustion and renders the service unresponsive. The issue is tracked under [CWE-674] (Uncontrolled Recursion) and was patched in SQLFluff 4.1.0.

Critical Impact

Remote, unauthenticated attackers can exhaust CPU and memory on any service that lints attacker-controlled SQL, disrupting availability of dependent applications.

Affected Products

  • SQLFluff versions prior to 4.1.0
  • Applications and CI/CD pipelines that expose the SQLFluff parser to untrusted SQL input
  • Web services that accept user-submitted SQL for linting or formatting

Discovery Timeline

  • 2026-06-09 - CVE-2026-46373 published to NVD
  • 2026-06-10 - Last updated in NVD database

Technical Details for CVE-2026-46373

Vulnerability Analysis

SQLFluff parses SQL queries into an abstract syntax tree before applying linting rules. The parser does not enforce a maximum recursion depth or expression nesting limit. When supplied with a query containing deeply nested expressions, parentheses, or subqueries, the parser recurses or iterates through each level. CPU consumption and memory allocation grow disproportionately to input size. A single small payload can monopolize a worker process and stall additional requests.

The vulnerability is exploitable over the network with no privileges and no user interaction. Confidentiality and integrity are not affected, but availability is fully compromised on the targeted process.

Root Cause

The root cause is uncontrolled recursion during parsing [CWE-674]. SQLFluff accepts arbitrarily nested grammar constructs and processes each level without bounding the parse tree depth or aborting on resource pressure. Version 4.1.0 introduces limits that reject pathological inputs before they exhaust process resources.

Attack Vector

An attacker submits a crafted SQL string to any endpoint that forwards input to the SQLFluff parser. Examples include hosted SQL linting services, code review bots, IDE plugins receiving remote payloads, or self-service data platforms that lint user queries before execution. The malicious payload typically consists of thousands of nested parentheses, repeated SELECT subqueries, or stacked CASE expressions designed to maximize parser depth.

No authentication is required when the lint endpoint is publicly reachable. Repeated requests amplify the impact and can take down multi-tenant linting workers.

No verified public proof-of-concept code is available. For technical details refer to the GitHub Security Advisory GHSA-wmhf-fqc8-vxhh.

Detection Methods for CVE-2026-46373

Indicators of Compromise

  • Sustained high CPU or memory utilization in processes running sqlfluff lint or sqlfluff parse
  • SQL inputs containing unusually deep nesting, such as hundreds of consecutive ( characters or repeated subquery wrappers
  • Linting worker timeouts, OOM kills, or container restarts correlated with specific user-submitted queries

Detection Strategies

  • Log the size and nesting depth of incoming SQL payloads at the application layer and alert on outliers
  • Monitor parser worker processes for runtime exceeding a defined budget and capture the offending input
  • Inspect HTTP request bodies routed to linting endpoints for patterns of repeated nested tokens

Monitoring Recommendations

  • Track per-request CPU time and memory allocation for parsing services and emit metrics to your observability stack
  • Alert on repeated client requests that produce parser timeouts or process restarts from a single source
  • Retain raw payloads associated with resource exhaustion events to support post-incident analysis

How to Mitigate CVE-2026-46373

Immediate Actions Required

  • Upgrade SQLFluff to version 4.1.0 or later in all environments that parse untrusted SQL
  • Inventory CI/CD pipelines, internal tools, and SaaS components that embed SQLFluff and verify their pinned versions
  • Restrict network access to linting endpoints so only authenticated, trusted users can submit queries

Patch Information

The maintainers fixed the issue in SQLFluff 4.1.0. Upgrade with pip install --upgrade sqlfluff>=4.1.0 and rebuild any container images or lockfiles that pin earlier releases. Review the GitHub Security Advisory GHSA-wmhf-fqc8-vxhh for full remediation guidance.

Workarounds

  • Enforce a maximum input size on SQL submitted to the linter, rejecting payloads above a reasonable byte threshold
  • Run the parser under strict CPU and memory cgroup limits with short execution timeouts to contain abusive inputs
  • Pre-filter inputs to reject queries exceeding a fixed parenthesis or nesting depth before they reach SQLFluff
bash
# Configuration example: upgrade SQLFluff and enforce a parse timeout
pip install --upgrade 'sqlfluff>=4.1.0'

# Run linting with a hard wall-clock limit to contain malicious inputs
timeout 10s sqlfluff lint --dialect ansi user_query.sql

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.