CVE-2026-18503

Description

A flaw was found in the csv.Sniffer.sniff() function within Python. An attacker can exploit this by providing specially crafted CSV samples, which can trigger super-linear regular-expression processing during dialect sniffing. This excessive processing consumes significant CPU resources, potentially leading to a Denial of Service (DoS) for applications that process unbounded input using this function.

Statement

Red Hat has evaluated this issue and determined it has a Low security impact. The csv.Sniffer.sniff() function in Python's standard library is vulnerable to excessive CPU consumption when processing specially crafted CSV input, due to quadratic time complexity in the dialect sniffing regex. Most applications are not affected as they use csv.reader() or csv.DictReader() directly without invoking the sniffing functionality.

Mitigation

Do not pass untrusted or unbounded CSV input to csv.Sniffer.sniff(). If dialect detection is needed, limit the size of the sample passed to sniff() or use a known dialect directly with csv.reader().

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score2.8N/AN/A
Attack VectorLocalN/AN/A
Attack ComplexityLowN/AN/A
Privileges RequiredLowN/AN/A
User InteractionRequiredN/AN/A
ScopeUnchangedN/AN/A
ConfidentialityNoneN/AN/A
Integrity ImpactNoneN/AN/A
Availability ImpactLowN/AN/A

Vector

Red Hat: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L

Understanding the Weakness (CWE)

Availability

Technical Impact: DoS: Resource Consumption (CPU)

Attackers can create crafted inputs that intentionally cause the regular expression to use excessive backtracking in a way that causes the CPU consumption to spike.

Frequently Asked Questions

Want to get errata notifications? Sign up here.