VAITP Dataset

← Back to the dataset

CVE-2026-123660

Memory‑exhaustion DoS via unbounded Python format specifiers in webhook templates.

  • CVSS 5.3
  • CWE-674
  • Resource Management
  • Remote

In Vulnerability-Lookup 5.5.1 up to but not including 6.4.1, a signed-in user could make the server allocate memory far out of proportion to their input through a webhook notification's payload template. Each placeholder's format specifier was passed unchanged to Python's string formatting, which builds the padded result before its size can be checked. A template of a few dozen bytes, such as {"text": "{title:>999999999}"}, therefore produced a string of about 1 GB when the notification form test-rendered it on save, and repeating such fields multiplied the cost. Templates that passed the save check could also repeat placeholders such as {text} thousands of times; the notification daemon rebuilt those on every webhook delivery. Deeply nested templates raised an unhandled recursion error (HTTP 500). An attacker needs only an account, which the default configuration lets anyone create after e-mail confirmation. They could exhaust the memory of web workers or the notification daemon, causing a denial of service. Version 6.4.1 caps every number in a format specifier at 256, limits a rendered template to 1,000,000 characters both on save and at delivery, and rejects templates nested deeper than 32 levels.

CVSS base score
5.3
Published
2026-11-06
OWASP
A04 Insecure Design
Orthogonal defect classification
Timing/Serialization
Code defect classification
Serialization Issues
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
Python
Fixed by upgrading
Yes

Solution

Upgrade to Vulnerability‑Lookup 6.4.1 (or later).

Vulnerable code sample

import re

def render_template(template: str, context: dict) -> str:
    """
    Render a webhook payload template using Python's format strings.
    Vulnerable: format specifiers are passed unchecked, allowing huge padding.
    """
    # VULNERABLE: unchecked format specifiers can cause massive memory allocation
    return template.format(**context)

Patched code sample

import re

def _cap_widths(spec: str) -> str:
    """
    Limit any numeric width in a format specifier to 256.
    """
    def repl(m):
        width = int(m.group(1))
        return f"{min(width, 256)}"
    # matches patterns like :>123 or :<456 or :^789
    return re.sub(r":([<^>])(\d+)", lambda m: f":{m.group(1)}{repl(m)}", spec)

def render_template(template: str, context: dict) -> str:
    """
    Render a webhook payload template with safety caps.
    """
    # FIX: cap numeric widths and limit final size
    safe_template = re.sub(r"\{[^}]+\}", lambda m: _cap_widths(m.group(0)), template)
    result = safe_template.format(**context)
    if len(result) > 1_000_000:
        raise ValueError("Rendered template exceeds size limit")
    return result

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.

  • fix: [notifications] Bound what a webhook payload template (vulnerability-lookup/vulnerability-lookup)
    website/notifications/webhooks.py, website/notifications/webhooks.py · build_exposure_payload, website/notifications/webhooks.py · build_payload, website/notifications/webhooks.py · validate_payload_template, website/notifications/webhooks.py · _format_template, website/notifications/webhooks.py · _substitute

Cite this entry

@misc{vaitp:cve2026123660,
  title        = {{Memory‑exhaustion DoS via unbounded Python format specifiers in webhook templates.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-123660},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-123660/}}
}

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.