Slow String Operations via MultiPart Requests in Event-Driven Functions
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-400.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| brefphp | bref | before 2.1.17 | 2.1.17 | Patch available | CNA |
| — | bref/bref (Packagist) | before 2.1.17 | 2.1.17 | Patch available | GHSA-j4hq-f63x-f39r |
- bref Vendorbrefphp Affected before 2.1.17 Fixed in 2.1.17 Patch available CNA
- bref/bref (Packagist) Vendor— Affected before 2.1.17 Fixed in 2.1.17 Patch available GHSA-j4hq-f63x-f39r
Remediation
- Fix · CNA bref (brefphp) Fixed in 2.1.17
- Fix · GHSA-j4hq-f63x-f39r bref/bref (Packagist) Fixed in 2.1.17 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-29186
- 2026-10-03 Alias added: GHSA-j4hq-f63x-f39r
References
More brefphp Bref vulnerabilities
- TI-2024-16271 Bref Body Parsing Inconsistency in Event-Driven Functions CVSS 3.1CRITICAL 9.8
- TI-2024-16270 Bref Multiple Value Headers Not Supported in ApiGatewayFormatV2 CVSS 3.1MEDIUM 6.5
- TI-2024-16269 Bref Uploaded Files Not Deleted in Event-Driven Functions CVSS 3.1MEDIUM 6.5
Sources
- CVE-2024-29186 · CVE Program
- CVE-2024-29186 · NVD
- FIRST EPSS
- GHSA-j4hq-f63x-f39r · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences