Duplicate Advisory: Denial of Service in sqlparse

sqlparse Updated 02 Oct 2025

Summary

30/04/2024
HIGH
Yes i
High
7.5

GHSA-62qf-jcq8-8gxw: Duplicate Advisory: sqlparse parsing heavily nested list leads to Denial of Service. Affects sqlparse versions < 0.5.0. Fixed in 0.5.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

sqlparse is a Python library used for parsing SQL statements. It provides functionality to analyze and manipulate SQL queries. The library is commonly used in applications that interact with databases. However, a vulnerability has been discovered in sqlparse that can lead to a Denial of Service (DoS) attack when parsing heavily nested lists.

Vulnerability Detail

The vulnerability in sqlparse arises when a heavily nested list is passed to the sqlparse.parse() function. This triggers a RecursionError, causing the application to crash or become unresponsive. An attacker can exploit this vulnerability by crafting a malicious SQL query with a deeply nested list, leading to a DoS condition. The impact of this vulnerability is a disruption of service, potentially affecting the availability of the application.

How To Fix

Latest published version: 0.6.0 as of 23 Oct 2026

pip install --upgrade "sqlparse==0.6.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.5.0

This is the first release that contains the fix.

pip install --upgrade "sqlparse==0.5.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability. Updating the sqlparse library to the latest version is the recommended solution.

Conclusion

The sqlparse library is vulnerable to a Denial of Service (DoS) attack when parsing heavily nested lists. To mitigate this vulnerability, it is crucial to update the library to version 0.5.0 or later. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for sqlparse →

Share this vulnerability

FAQ

sqlparse is a Python library used for parsing SQL statements. It provides functionality to analyze and manipulate SQL queries.

The vulnerability can lead to a Denial of Service (DoS) attack, causing the application to crash or become unresponsive.

An attacker can exploit this vulnerability by crafting a malicious SQL query with a deeply nested list, leading to a DoS condition.

To fix this vulnerability, update the sqlparse library to version 0.5.0 or later.

There is no specific workaround mentioned for this vulnerability. Updating the sqlparse library to the latest version is the recommended solution.

Related vulnerabilities

Recent vulnerabilities recorded for sqlparse.

How To Fix

Latest published version: 0.6.0 as of 23 Oct 2026

pip install --upgrade "sqlparse==0.6.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.5.0

This is the first release that contains the fix.

pip install --upgrade "sqlparse==0.5.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback