
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-18503 is a denial-of-service vulnerability in CPython's csv.Sniffer.sniff() function caused by super-linear (quadratic) regular expression backtracking during CSV dialect detection. When applications pass unbounded, attacker-controlled CSV input to csv.Sniffer.sniff(), the internal _guess_quote_and_delimiter() method's lazy regex matching can consume significant CPU — benchmarks showed processing times exceeding 20 seconds on ~1 MB samples and minutes on single-column quoted data. It affects CPython versions prior to 3.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7, and 3.15.0rc1, and was published on August 10, 2026. The CVSS v4.0 base score is 2.4 (Low), assigned by the Python Software Foundation (GitHub Advisory, CPython Issue).
The root cause is classified as CWE-1176 (Inefficient CPU Computation). The _guess_quote_and_delimiter() method in Lib/csv.py used lazy quantifiers (.*?) in regular expressions to match the body of quoted CSV fields. Because a lazy match scans to the end of the sample and retries from every position when a closing quote is not followed by a delimiter, the regex engine exhibits quadratic time complexity relative to input size. The fix replaces the lazy quantifier with a possessive match ((?:(?P=quote){2}|(?!(?P=quote)).)*+) so the body ends at the first non-doubled quote, matching the actual CSV reader's behavior and reducing complexity to linear. Exploitation requires an attacker to supply a crafted CSV sample — such as a large single-column file of quoted fields — to an application that passes unbounded input to csv.Sniffer.sniff() (CPython PR #153694, CPython Commit 476fb09).
Successful exploitation causes excessive CPU consumption on the affected Python process, leading to service degradation or effective denial of service for applications that process user-supplied CSV data via csv.Sniffer.sniff(). There is no confidentiality or integrity impact — only availability is affected, and only at the vulnerable component level. The impact is limited to the specific process handling the malicious input; lateral movement or data exfiltration are not applicable to this vulnerability (GitHub Advisory).
There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the disclosure date (GitHub Advisory). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog, and the NVD SSVC assessment rates exploitation as "none." The EPSS score is approximately 0.00114, indicating a very low probability of exploitation in the near term. Exploitation is not automatable per the CVSS v4.0 assessment, as it requires user interaction (passive) and local access or the ability to supply input to an application that calls csv.Sniffer.sniff() without input size limits.
csv.Sniffer.sniff()."abcdefghijklmnopqrstuvwxyz"\n repeated. A ~1 MB sample is sufficient to cause >20 seconds of CPU consumption.csv.Sniffer.sniff(data) on the unbounded input; the lazy regex in _guess_quote_and_delimiter() backtracks quadratically, consuming CPU for an extended period._csv.Error: Could not determine delimiter after extended delays.Upgrade CPython to one of the patched versions: 3.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7, or 3.15.0rc1. Backport commits are available for each maintenance branch (e.g., commit 063d455 for 3.12, 476fb09 for 3.15, 89f29c7 for 3.14) (CPython Commit 063d455). As a workaround prior to patching, enforce strict input size limits on CSV data before passing it to csv.Sniffer.sniff() (e.g., limit samples to a few kilobytes), implement request timeouts, and monitor CPU usage to detect and throttle abusive requests (GitHub Advisory).
The Python Software Foundation (PSF) disclosed the vulnerability via the security-announce@python.org mailing list and published a GitHub Security Advisory. The fix was developed by CPython core developer Serhiy Storchaka, who noted the underlying issue had been tracked since at least October 2022 (issue #98820) and that the old regex was quadratic on quoted data. The broader community response has been low-key given the low CVSS score and limited exploitability, with no notable threat actor activity or significant media coverage observed (Python Security Announce, CPython PR #153694).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."