Project

General

Profile

Actions

Bug #62

closed

Improper Handling of Malformed Multipart Requests Leading to Potential Connection Exhaustion (API-WEB)

Added by Vivek Kumar 21 days ago. Updated 12 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Start date:
03/31/2026
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

The /api/clients/add endpoint does not properly handle malformed multipart/form-data requests. When an incorrect multipart boundary is provided, the server does not reject the request and instead keeps the connection open without returning a response.

This indicates that:

  • Multipart parsing does not fail fast on invalid input
  • No request parsing timeout is enforced
  • Connections remain open while the server waits for completion of the request body

Proof of Concept (PoC)

  1. Send malformed multipart request
    Header:
    Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryABC
    Body (intentionally incorrect boundary):
------WebKitFormBoundaryABC
Content-Disposition: form-data; name="first_name"

test
------WebKitFormBoundaryABC2
  1. Observed behavior
    No HTTP response returned
    No status code received
    Connection remains open indefinitely
    Tool show request as pending (e.g., size = -1)

  2. Validation
    When boundary is corrected → request completes successfully
    When malformed → request hangs indefinitely

Testing Performed

Opened 100+ concurrent malformed requests
Observed:

  • Connections remained open
  • No immediate service disruption
  • Legitimate requests continued to succeed

Observed Behavior
Server accepts malformed request but does not terminate it
No timeout or error response is triggered
Connections persist indefinitely until manually closed

Expected Behavior
Server should:

  • Immediately reject malformed multipart requests with: HTTP/1.1 400 Bad Request
    OR
  • Enforce request/body read timeout and close connection
Actions #1

Updated by Adhi Narayanan 18 days ago

  • % Done changed from 0 to 100
Actions #2

Updated by Adhi Narayanan 18 days ago

  • Status changed from New to Resolved
Actions #3

Updated by Vivek Kumar 12 days ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF