# CVE-2024-29186: Slow String Operations via MultiPart Requests in Event-Driven Functions

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.3
- **CVSS:** 5.3 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: Low
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.77% (percentile 52, 2026-11-26)
- **CWE:** CWE-400
- **Aliases:** GHSA-j4hq-f63x-f39r
- **Published:** 2024-03-22T16:57:40.000Z
- **Modified:** 2026-09-10T03:50:10.683Z

## Who should check

- Projects that depend on Packagist package bref/bref (\< 2.1.17)
- Anyone running brefphp bref \< 2.1.17

## Description

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.

## Affected and fixed versions

- Packagist `bref/bref`: affected \< 2.1.17; fixed 2.1.17 (osv)
- brefphp bref: \< 2.1.17 (cvelist)

## Mitigation

- Upgrade bref/bref to 2.1.17 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-29186. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-29186.md
Affected: bref/bref < 2.1.17
Fixed in: 2.1.17

Steps:
1. Search this machine and project for bref/bref (Packagist), brefphp bref: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-29186 being exploited?

There is no confirmed exploitation: CVE-2024-29186 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.77% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-29186?

Medium: CVSS 5.3 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2024-29186?

bref/bref \< 2.1.17.

### Is there a fix for CVE-2024-29186?

Yes. Fixed in 2.1.17. Upgrade bref/bref to 2.1.17 or later.

### How do I check if I'm affected by CVE-2024-29186?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/brefphp/bref/security/advisories/GHSA-j4hq-f63x-f39r>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2024-29186>
- patch: <https://github.com/brefphp/bref/commit/5f7c0294628dbcec6305f638ff7e2dba8a1c2f45>
- other: <https://github.com/brefphp/bref>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-29186>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-j4hq-f63x-f39r> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2024-29186> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-29186>
