Skip to main content

Inefficient Regular Expression Complexity in gradio

CVE-2024-10624

  • gradio
Severity High
Score 7.5/10

Summary

A Regular Expression Denial of Service (ReDoS) vulnerability exists in the gradio-app/gradio, affecting the "gr.Datetime" component. The vulnerability arises from the use of a regular expression `^(?:\s*now\s*(?:-\s*(\d+)\s*([dmhs]))?)?\s*$` to process user input. In Python's default regex engine, this regular expression can take polynomial time to match certain crafted inputs. An attacker can exploit this by sending a crafted HTTP request, causing the gradio process to consume 100% CPU and potentially leading to a Denial of Service (DoS) condition on the server. This issue affects 4.38.0 and later.

  • 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