Skip to content
Heist/ feed
Back to feed
Medium

Slow String Operations via MultiPart Requests in Event-Driven Functions

Type: advisorySources: OSV

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 t

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-29186
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 20:12 UTC · Revision 1

Source evidence

Slow String Operations via MultiPart Requests in Event-Driven Functions

core-osv · Original source

Published 22 Mar 2024, 17:07 UTC

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 t

osv:CVE-2024-29186
Complete source record
{
  "id": "ee364fab05b75a78b579cd1826f3e420768f9e8d96c3e56cd71d0a82a6722e92",
  "url": "https://osv.dev/vulnerability/CVE-2024-29186",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Slow String Operations via MultiPart Requests in Event-Driven Functions",
    "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 t",
    "evidence": "osv:CVE-2024-29186",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2024-29186",
      "aliases": [
        "CVE-2024-29186",
        "GHSA-j4hq-f63x-f39r"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/brefphp/bref",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "6041ad7d5ca1901dfb91323c9a903ec0d4fc9333"
                },
                {
                  "fixed": "5f7c0294628dbcec6305f638ff7e2dba8a1c2f45"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:mnapoli:bref:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.1.17"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "5f7c0294628dbcec6305f638ff7e2dba8a1c2f45"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "2.1.16",
            "2.1.15",
            "2.1.14",
            "2.1.13",
            "2.1.12",
            "2.1.11",
            "2.1.10",
            "2.1.9",
            "2.1.8",
            "2.1.7",
            "2.1.6",
            "2.1.5",
            "2.1.4",
            "2.1.3",
            "2.1.2",
            "2.1.1",
            "2.1.0",
            "2.0.11",
            "2.0.10",
            "2.0.8",
            "2.0.9",
            "2.0.7",
            "2.0.6",
            "2.0.5",
            "2.0.4",
            "2.0.3",
            "2.0.2",
            "2.0.1",
            "2.0.0",
            "1.7.24",
            "1.7.23",
            "1.7.22",
            "1.7.21",
            "1.7.20",
            "1.7.19",
            "1.7.18",
            "1.7.17",
            "1.7.16",
            "1.7.15",
            "1.7.14",
            "1.7.13",
            "1.7.12",
            "1.7.11",
            "1.7.10",
            "1.7.9",
            "1.7.8",
            "1.7.7",
            "1.7.6",
            "1.7.5",
            "1.7.4",
            "1.7.3",
            "1.7.2",
            "1.7.1",
            "1.7.0",
            "1.6.0",
            "1.5.8",
            "1.5.7",
            "1.5.6",
            "1.5.5",
            "1.5.4",
            "1.5.3",
            "1.5.2",
            "1.5.1",
            "1.5.0",
            "1.4.2",
            "1.4.1",
            "1.4.0",
            "1.3.6",
            "1.3.5",
            "1.3.4",
            "1.3.3",
            "1.3.2",
            "1.3.1",
            "1.3.0",
            "1.2.14",
            "1.2.13",
            "1.2.12",
            "1.2.11",
            "1.2.10",
            "1.2.9",
            "1.2.8",
            "1.2.7",
            "1.2.6",
            "1.2.5",
            "1.2.4",
            "1.2.3",
            "1.2.2",
            "1.2.1",
            "1.2.0",
            "1.1.4",
            "1.1.3",
            "1.1.2",
            "1.1.1",
            "1.1.0",
            "1.0.2",
            "1.0.1",
            "1.0.0",
            "0.5.33",
            "1.0.0-beta1",
            "0.5.32",
            "0.5.31",
            "0.5.30",
            "0.5.14-beta1",
            "0.5.29",
            "0.5.28",
            "0.5.27",
            "0.5.26",
            "0.5.25",
            "0.5.24",
            "0.5.23",
            "0.5.22",
            "0.5.21",
            "0.5.20",
            "0.5.19",
            "0.5.18",
            "0.5.17",
            "0.5.16",
            "0.5.15",
            "0.5.14",
            "0.5.14-beta2",
            "0.5.13",
            "0.5.12",
            "0.5.3",
            "0.5.2",
            "0.5.1",
            "0.5.0",
            "0.5.0-beta1",
            "0.4.1",
            "0.4.0",
            "0.3.9",
            "0.3.5",
            "0.3.8",
            "0.3.7",
            "0.3.6",
            "0.3.4",
            "0.3.3",
            "0.3.2",
            "0.3.1",
            "0.3.0",
            "0.2.37",
            "0.2.36",
            "0.2.35",
            "0.2.34",
            "0.2.33",
            "0.2.32",
            "0.2.31",
            "0.2.30",
            "0.2.29",
            "0.2.28",
            "0.2.27",
            "0.2.26",
            "0.2.20",
            "0.2.19",
            "0.2.18",
            "0.2.17",
            "0.2.16",
            "0.2.15",
            "0.2.14",
            "0.2.13",
            "0.2.12",
            "0.2.11",
            "0.2.10",
            "0.2.9",
            "0.2.8",
            "0.2.7",
            "0.2.6",
            "0.2.5",
            "0.2.4",
            "0.2.3",
            "0.2.2",
            "0.2.1",
            "0.2.0",
            "0.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-29186.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:32.181244253Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/29xxx/CVE-2024-29186.json",
        "https://github.com/brefphp/bref/security/advisories/GHSA-j4hq-f63x-f39r",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-29186",
        "https://github.com/brefphp/bref/commit/5f7c0294628dbcec6305f638ff7e2dba8a1c2f45"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-400"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/29xxx/CVE-2024-29186.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-29186",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 498907,
  "published_at": "2024-03-22T17:07:10.899+00:00"
}