CVE-2024-29186 json
Slow String Operations via MultiPart Requests in Event-Driven Functions
published 2024-03-22 2 y ago modified 2026-09-10 1 mo ago also EUVD-2024-0944 , GHSA-j4hq-f63x-f39r
- cvss
- 5.3
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.7%
- EPSS 0.7% chance of exploitation in 30 days, percentile 52%
- public exploits
- 0
- none known
Summary
Bref is an open-source project that helps users go serverless on Amazon Web Services with PHP. When Bref prior to version 2.1.17 is used with the Event-Driven Function runtime and the handler is a `RequestHandlerInterface`, then the Lambda event is converted to a PSR7 object. During the conversion process, if the request is a MultiPart, each part is parsed. In the parsing process, the `Content-Type` header of each part is read using the `Riverline/multipart-parser` library.
The library, in the `StreamedPart::parseHeaderContent` function, performs slow multi-byte string operations on the header value. Precisely, the `mb_convert_encoding` function is used with the first (`$string`) and third (`$from_encoding`) parameters read from the header value.
An attacker could send specifically crafted requests which would force the server into performing long operations with a consequent long billed duration.
The attack has the following requirements and limitations: The Lambda should use the Event-Driven Function runtime and the `RequestHandlerInterface` handler and should implement at least an endpoint accepting POST requests; the attacker can send requests up to 6MB long (this is enough to cause a billed duration between 400ms and 500ms with the default 1024MB RAM Lambda image of Bref); and if the Lambda uses a PHP runtime <= php-82, the impact is higher as the billed duration in the default 1024MB RAM Lambda image of Bref could be brought to more than 900ms for each request. Notice that the vulnerability applies only to headers read from the request body as the request header has a limitation which allows a total maximum size of ~10KB.
Version 2.1.17 contains a fix for this issue.
Patch / fix
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.67% chance of exploitation in the next 30 days, higher than 52% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/brefphp/bref/security/advisories/GHSA-j4hq-f63x-f39r referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| GitHub | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| packagist | bref/bref | <2.1.17 |
2.1.17 |
Affected products
- brefphp bref
Classification
- Weakness
-
- CWE-400 Uncontrolled Resource Consumption
References
-
github.com
/brefphp/bref/commit/5f7c0294628dbcec6305f638ff7e2dba8a1c2f45
web, patch
-
github.com
/brefphp/bref/security/advisories/GHSA-j4hq-f63x-f39r
web, exploit, release-notes
-
nvd.nist.gov
/vuln/detail/CVE-2024-29186
advisory
-
github.com
/brefphp/bref
package
Sources
- CVE List CVE-2024-29186
- GitHub Advisory GHSA-j4hq-f63x-f39r
- NVD CVE-2024-29186
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.