🔍 CVE-2024-29186

5.3
CVSS Score
MEDIUM
2024-03-22
2026-06-17 07:22
✅ 완료

🇰🇷 한글 설명

Bref의 Event-Driven Function 런타임에서 MultiPart 요청의 Content-Type 헤더를 처리할 때 발생하는 취약점입니다. Riverline/multipart-parser 라이브러리의 mb_convert_encoding 함수가 느린 멀티바이트 문자열 연산을 수행하여 서버의 처리 시간을 비정상적으로 늘릴 수 있습니다. 이는 결과적으로 AWS Lambda의 과도한 실행 시간(Billed Duration)을 유발하여 비용 상승을 초래할 수 있습니다.

💡 쉬운 설명

공격자가 특수하게 조작된 데이터를 보내면 서버가 이를 처리하는 데 아주 오랜 시간이 걸리게 만드는 공격입니다. 이로 인해 서버 비용이 예상보다 훨씬 많이 나올 수 있습니다.

🇺🇸 원문 (English)

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.

📍 영향받는 시스템

Bref version < 2.1.17 (Event-Driven Function runtime & RequestHandlerInterface 사용 시)

⚔️ 공격 벡터

조작된 Content-Type 헤더를 포함한 MultiPart POST 요청 전송

🛡️ 대응 방법

Bref 버전을 2.1.17 이상으로 업데이트

🔧 검증 코드

출력된 버전 정보가 2.1.17 미만인지 확인합니다.

Shell / Script
composer show bref/bref | grep 'versions'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

💻 영향받는 소프트웨어

Spring Web Services