CVE-2023-30608: Vulnerability in sqlparse - Regular Expression Denial of Service

sqlparse Updated 02 Oct 2025

Summary

21/04/2023
Yes i
Moderate
5.5

CVE-2023-30608: sqlparse contains a regular expression that is vulnerable to Regular Expression Denial of Service. Affects sqlparse versions >= 0.1.15, < 0.4.4. Fixed in 0.4.4. How to fix ↓

Also tracked for

The same CVE-2023-30608 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

sqlparse is a Python library that provides a SQL parser. It is commonly used to parse and analyze SQL queries in various applications. The library allows developers to extract information from SQL statements and perform operations on them. However, sqlparse is vulnerable to Regular Expression Denial of Service (ReDoS), a type of attack that can lead to Denial of Service (DoS) by exploiting the regular expression used in the SQL parser.

Vulnerability Detail

The vulnerability in sqlparse arises from a regular expression used in the SQL parser. This regular expression is susceptible to ReDoS attacks, where an attacker can provide a specially crafted input that causes the regular expression to take an excessive amount of time to evaluate. This can result in a DoS condition, where the application becomes unresponsive or crashes. The vulnerability has a CVSS score of 5.5, indicating a moderate severity level.

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.4.4

This is the first release that contains the fix.

pip install --upgrade "sqlparse==0.4.4"

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

Workaround

There are no known workarounds for this vulnerability. It is essential to update sqlparse to the latest version to mitigate the risk of ReDoS attacks.

Conclusion

The vulnerability in sqlparse exposes applications to the risk of Denial of Service (DoS) attacks. To mitigate this risk, it is crucial to update sqlparse to version 0.4.4 or later. This update fixes the vulnerable regular expression and ensures the secure functioning of the SQL parser. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for sqlparse →

Share this vulnerability

FAQ

sqlparse is a Python library used for parsing and analyzing SQL queries.

ReDoS stands for Regular Expression Denial of Service, a type of attack that exploits vulnerabilities in regular expressions to cause a DoS condition.

The vulnerability in sqlparse can lead to Denial of Service (DoS) if exploited. An attacker can provide malicious input that causes the SQL parser to consume excessive processing time, resulting in unresponsiveness or crashes.

To fix this vulnerability, update sqlparse to version 0.4.4 or later. This ensures that the vulnerable code is replaced with a secure implementation.

No, there are no known workarounds for this vulnerability. Updating sqlparse 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.4.4

This is the first release that contains the fix.

pip install --upgrade "sqlparse==0.4.4"

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