Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2023-26044: Merge pull request from GHSA-95x4-j7vc-h8mf · reactphp/http@9681f76

react/http is an event-driven, streaming HTTP client and server implementation for ReactPHP. Previous versions of ReactPHP’s HTTP server component contain a potential DoS vulnerability that can cause high CPU load when processing large HTTP request bodies. This vulnerability has little to no impact on the default configuration, but can be exploited when explicitly using the RequestBodyBufferMiddleware with very large settings. This might lead to consuming large amounts of CPU time for processing requests and significantly delay or slow down the processing of legitimate user requests. This issue has been addressed in release 1.9.0. Users are advised to upgrade. Users unable to upgrade may keep the request body limited using RequestBodyBufferMiddleware with a sensible value which should mitigate the issue. An infrastructure or DevOps workaround could be to place a reverse proxy in front of the ReactPHP HTTP server to filter out any excessive HTTP request bodies.

CVE
#vulnerability#git#php

Expand Up

@@ -26,6 +26,13 @@ final class MultipartParser

*/

private $maxFileSize;

/**

* Based on $maxInputVars and $maxFileUploads

*

* @var int

*/

private $maxMultipartBodyParts;

/**

* ini setting “max_input_vars”

*

Expand Down Expand Up

@@ -62,6 +69,7 @@ final class MultipartParser

*/

private $maxFileUploads;

private $multipartBodyPartCount = 0;

private $postCount = 0;

private $filesCount = 0;

private $emptyCount = 0;

Expand All

@@ -87,6 +95,8 @@ public function __construct($uploadMaxFilesize = null, $maxFileUploads = null)

$this->uploadMaxFilesize = IniUtil::iniSizeToBytes($uploadMaxFilesize);

$this->maxFileUploads = $maxFileUploads === null ? (\ini_get(‘file_uploads’) === ‘’ ? 0 : (int)\ini_get(‘max_file_uploads’)) : (int)$maxFileUploads;

$this->maxMultipartBodyParts = $this->maxInputVars + $this->maxFileUploads;

}

public function parse(ServerRequestInterface $request)

Expand All

@@ -101,6 +111,7 @@ public function parse(ServerRequestInterface $request)

$request = $this->request;

$this->request = null;

$this->multipartBodyPartCount = 0;

$this->postCount = 0;

$this->filesCount = 0;

$this->emptyCount = 0;

Expand Down Expand Up

@@ -128,6 +139,10 @@ private function parseBody($boundary, $buffer)

// parse one part and continue searching for next

$this->parsePart(\substr($buffer, $start, $end - $start));

$start = $end;

if (++$this->multipartBodyPartCount > $this->maxMultipartBodyParts) {

break;

}

}

}

Expand Down

Related news

GHSA-95x4-j7vc-h8mf: ReactPHP's HTTP server continues parsing unused multipart parts after reaching input field and file upload limits

### Summary Previous versions of ReactPHP's HTTP server component contain a potential DoS vulnerability that can cause high CPU load when processing large HTTP request bodies. This vulnerability has little to no impact on the default configuration, but can be exploited when explicitly using the `RequestBodyBufferMiddleware` with very large settings. This might lead to consuming large amounts of CPU time for processing requests and significantly delay or slow down the processing of legitimate user requests. ### Patches The supplied patch resolves this vulnerability for ReactPHP. ### Workarounds - Keeping the request body limit using `RequestBodyBufferMiddleware` sensible will mitigate it. - Infrastructure or DevOps can place a reverse proxy in front of the ReactPHP HTTP server to filter out any excessive HTTP request bodies. ### References A similar vulnerability was discovered in PHP recently, see also [PHP's security advisory](https://github.com/php/php-src/security/advisorie...

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda