Skip to main content

Inefficient Regular Expression Complexity

CVE-2024-24762

Severity High
Score 7.5/10

Summary

FastAPI is a web framework for building APIs with Python 3.8+ based on standard Python-type hints. When using form data, `python-multipart` uses a Regular Expression to parse the HTTP `Content-Type` header, including options. An attacker could send a custom-made `Content-Type` option that is very difficult for the RegEx to process, consuming CPU resources and stalling indefinitely (minutes or more) while holding the main event loop. This means that the process can't handle any more requests. It's a ReDoS (Regular expression Denial of Service), it only applies to those reading form data, using `python-multipart`. This vulnerability affects fastapi versions prior to 0.109.1.

  • LOW
  • NETWORK
  • NONE
  • UNCHANGED
  • NONE
  • NONE
  • NONE
  • HIGH

CWE-1333 - Inefficient Regular Expression Complexity

The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.

Advisory Timeline

  • Published