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

bref/bref Updated 02 Oct 2025

Summary

01/02/2024
Yes i
Moderate
6.5

CVE-2024-24752: Bref's Uploaded Files Not Deleted in Event-Driven Functions. Affects bref/bref versions < 2.1.13. Fixed in 2.1.13. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Bref is an open-source project that allows developers to build serverless applications using PHP. It provides a framework for running PHP functions in response to events, such as HTTP requests. The vulnerable component in Bref is the Psr7Bridge class, specifically the parseBodyAndUploadedFiles method. This method is responsible for converting Lambda events to PSR7 objects and handling multipart requests. When a multipart request contains files, Bref saves them in temporary files in the /tmp directory. However, it fails to delete these temporary files after processing the request, leading to a potential disk space exhaustion vulnerability.

Vulnerability Detail

The vulnerability allows an attacker to fill the disk space of a Lambda instance by sending multiple multipart requests containing files. To exploit this vulnerability, the Lambda function must use the Event-Driven Function runtime, have a RequestHandlerInterface handler, and implement an endpoint that accepts POST requests. The attacker can send requests up to 6MB in size, requiring multiple requests to fill the disk. The impact of this vulnerability is limited to the affected Lambda instance's disk space.

How To Fix

Minimum fixed version

2.1.13

This is the first release that contains the fix.

composer require bref/bref:2.1.13

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can manually delete the temporary files in the /tmp directory after each request. This can be done using the unlink function in PHP. However, it is recommended to apply the official fix provided by the Bref project.

Conclusion

The Bref project is vulnerable to a disk space exhaustion vulnerability when using the Event-Driven Function runtime and a RequestHandlerInterface handler. Attackers can exploit this vulnerability by sending multiple multipart requests containing files. The impact is limited to the affected Lambda instance's disk space. To fix this vulnerability, the Bref project developers should modify the affected method to delete the temporary files after processing the request. Users can also manually delete the temporary files as a temporary workaround. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for bref/bref →

Share this vulnerability

FAQ

Bref is an open-source project that enables developers to build serverless applications using PHP. It provides a framework for running PHP functions in response to events, such as HTTP requests.

The vulnerability allows an attacker to fill the disk space of a Lambda instance by sending multiple multipart requests containing files. However, the impact is limited to the affected Lambda instance's disk space.

To exploit this vulnerability, the Lambda function must use the Event-Driven Function runtime, have a RequestHandlerInterface handler, and implement an endpoint that accepts POST requests.

To fix this vulnerability, the Bref project developers should modify the parseBodyAndUploadedFiles method in the Psr7Bridge class to delete the temporary files after processing the request and generating the response.

As a temporary workaround, users can manually delete the temporary files in the /tmp directory after each request. However, it is recommended to apply the official fix provided by the Bref project.

Related vulnerabilities

Recent vulnerabilities recorded for bref/bref.

How To Fix

Minimum fixed version

2.1.13

This is the first release that contains the fix.

composer require bref/bref:2.1.13

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback