VAITP Dataset

← Back to the dataset

CVE-2026-59966

Regex denial‑of‑service via unvalidated user‑controlled pattern in Automation.

  • CVSS 5.7
  • CWE-1333
  • Resource Management
  • Remote

Tandoor Recipes is an application for managing recipes, planning meals, and building shopping lists. Prior to 2.6.10, executes user-controlled Automation regular-expression patterns with Python re.sub() without complexity validation or an execution timeout when an authenticated user stores a catastrophic-backtracking regex and any user in the same Space imports a matching recipe. Request processing uses Automation.param_2, apply_regex_replace_automation, sub, api/recipe-from-source/. The attack works because the shared-Space automation engine evaluates the malicious pattern during recipe import and can occupy a Gunicorn worker until its request timeout. This can exhaust application worker slots and make the service unavailable to users. This issue is fixed in version 2.6.10.

CVSS base score
5.7
Published
2026-10-16
OWASP
A04 Insecure Design
Orthogonal defect classification
Timing/Serialization
Code defect classification
Timing Issues
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
Python

Solution

Upgrade to Tandoor Recipes v2.6.10 or newer.

Vulnerable code sample

import re

def apply_regex_replace_automation(text: str, pattern: str, replacement: str) -> str:
    # VULNERABLE: executes untrusted regex pattern leading to catastrophic backtracking
    return re.sub(pattern, replacement, text)

def import_recipe(recipe_source: str, automation_params: dict) -> str:
    """
    Simulated recipe import that applies a user‑defined automation step.
    """
    pattern = automation_params.get('param_2', '')
    repl = automation_params.get('replacement', '')
    return apply_regex_replace_automation(recipe_source, pattern, repl)

Patched code sample

import re

def apply_regex_replace_automation(text: str, pattern: str, replacement: str) -> str:
    # FIX: reject overly complex patterns to prevent catastrophic backtracking
    if len(pattern) > 100:
        raise ValueError("Regex pattern too long")
    return re.sub(pattern, replacement, text)

def import_recipe(recipe_source: str, automation_params: dict) -> str:
    """
    Simulated recipe import that applies a user‑defined automation step.
    """
    pattern = automation_params.get('param_2', '')
    repl = automation_params.get('replacement', '')
    return apply_regex_replace_automation(recipe_source, pattern, repl)

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • added timeouts for automation regex (TandoorRecipes/recipes)
    cookbook/helper/automation_helper.py, cookbook/helper/automation_helper.py · AutomationEngine.apply_regex_replace_automation, cookbook/helper/automation_helper.py · AutomationEngine.apply_transpose_automation

Cite this entry

@misc{vaitp:cve202659966,
  title        = {{Regex denial‑of‑service via unvalidated user‑controlled pattern in Automation.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-59966},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-59966/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.