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

CVE-2026-46374: SQLFluff DOS Vulnerability

CVE-2026-46374 is a denial of service vulnerability in SQLFluff that allows untrusted users to exhaust resources via malicious queries. This article covers the technical details, affected versions, impact, and mitigation.

Published:

CVE-2026-46374 Overview

CVE-2026-46374 is a denial of service vulnerability in SQLFluff, a modular SQL linter and auto-formatter that supports multiple SQL dialects and templated code. Versions prior to 4.2.0 allow an unauthenticated attacker to submit a specially crafted long SQL query that triggers resource exhaustion in the parser. Deployments that expose the linter to untrusted input are directly affected. The maintainers patched the issue in version 4.2.0.

Critical Impact

An unauthenticated, remote attacker can exhaust CPU and memory resources by submitting a malicious long query, causing the SQLFluff parser and any application embedding it to become unresponsive.

Affected Products

  • SQLFluff versions prior to 4.2.0
  • Applications and CI/CD pipelines embedding the SQLFluff parser to lint user-supplied SQL
  • Web services and APIs that expose SQLFluff linting to untrusted users

Discovery Timeline

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

Technical Details for CVE-2026-46374

Vulnerability Analysis

The vulnerability is an uncontrolled resource consumption flaw classified as [CWE-400]. SQLFluff's parser processes the entire input query to construct a syntactic representation before applying linting rules. When the parser receives an unusually long or pathologically structured query, its parsing logic consumes disproportionate CPU and memory. The result is a denial of service against any process invoking the parser.

The attack vector is network-based and requires no authentication or user interaction. Any deployment that accepts SQL strings from untrusted users and forwards them to SQLFluff for linting is exposed. Examples include SQL formatting web services, online SQL editors, code review bots, and continuous integration jobs that lint user-submitted pull requests.

Root Cause

The parser does not enforce upper bounds on input size or on the computational cost of parsing operations. Algorithmic complexity in the dialect-aware grammar amplifies the cost of processing long inputs, allowing modest payloads to produce large CPU and memory usage. The fix in version 4.2.0 introduces guards that limit the impact of malicious long queries.

Attack Vector

An attacker submits a crafted SQL string to any endpoint or process that passes input to the SQLFluff parser. The parser begins tokenizing and parsing the query, allocating memory and consuming CPU cycles until the host runs out of resources or the request times out. Repeated submissions sustain the denial of service. No authentication, privileges, or user interaction are required. See the GitHub Security Advisory GHSA-73jc-5mrq-prw7 for additional technical context.

Detection Methods for CVE-2026-46374

Indicators of Compromise

  • Sustained high CPU or memory usage by sqlfluff processes or by application workers invoking the parser
  • Unusually large SQL payloads received by linting endpoints, often exceeding typical query length distributions
  • Request timeouts and worker restarts correlated with traffic from a small set of source IPs

Detection Strategies

  • Inspect application logs for SQL inputs whose size exceeds expected thresholds before they reach the parser
  • Monitor process telemetry for sqlfluff invocations that exceed expected runtime or memory bounds
  • Correlate spikes in 5xx errors and worker terminations with inbound SQL linting requests

Monitoring Recommendations

  • Track parser execution time and memory per request and alert on outliers
  • Rate-limit requests to linting endpoints and log offending source addresses
  • Capture and retain payload sizes for forensic review when DoS indicators appear

How to Mitigate CVE-2026-46374

Immediate Actions Required

  • Upgrade SQLFluff to version 4.2.0 or later in all environments that process untrusted SQL
  • Enforce a maximum input length on any endpoint that forwards SQL to the parser
  • Run the linter in resource-constrained workers with CPU and memory limits and execution timeouts

Patch Information

The issue is patched in SQLFluff 4.2.0. Operators should pin to sqlfluff>=4.2.0 in dependency manifests and rebuild container images or virtual environments. Refer to the GitHub Security Advisory GHSA-73jc-5mrq-prw7 for the official remediation guidance.

Workarounds

  • Reject SQL inputs exceeding a sane byte limit at the application boundary before invoking the parser
  • Isolate SQLFluff in a sandboxed subprocess with strict CPU time and memory ceilings
  • Restrict linting endpoints to authenticated users and apply per-user rate limits
bash
# Configuration example: pin the patched version and enforce subprocess limits
pip install 'sqlfluff>=4.2.0'

# Linux example: bound CPU time and address space when invoking the linter
ulimit -t 10        # 10 seconds of CPU time
ulimit -v 524288    # 512 MB virtual memory
sqlfluff lint --dialect ansi input.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.