{"answers":{"affected":"2 open source packages ship an affected version, including bref/bref. It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-29186 in the wild and no public exploit code.","fix":"Upgrade bref/bref to 2.1.17 or later.","what":"CVE-2024-29186 is a medium-severity denial of service vulnerability in brefphp bref, published on 22 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-29186 and fix it if it is affected.\n\nWhat it is: CVE-2024-29186 is a medium-severity denial of service vulnerability in brefphp bref, published on 22 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-29186 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- bref/bref (Packagist): affected all versions; fixed in 2.1.17\n- bref/bref (Packagist): affected all versions; fixed in 2.1.17\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-29186/ (Markdown: https://insights.sbomify.com/CVE-2024-29186/index.md)","id":"CVE-2024-29186","markdown":"https://insights.sbomify.com/CVE-2024-29186/index.md","name":"CVE-2024-29186","record":{"aliases":["GHSA-j4hq-f63x-f39r"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":true,"product_category":"PHP serverless library","requires_auth":"none","summary":"Attackers can cause excessive CPU usage and billing costs in Bref PHP serverless functions by sending crafted multipart requests that trigger slow string operations.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"bref","vendor":"mnapoli"}],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","version":"3.1"},"cwes":[{"id":"CWE-400","name":"Uncontrolled Resource Consumption"}],"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.\n\nThe library, in the `StreamedPart::parseHeaderContent` function, performs slow multi-byte string operations on the header value.\nPrecisely, the `mb_convert_encoding` function is used with the first (`$string`) and third (`$from_encoding`) parameters read from the header value.\n\nAn attacker could send specifically crafted requests which would force the server into performing long operations with a consequent long billed duration.\n\nThe 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 \u003c= 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.\n\nVersion 2.1.17 contains a fix for this issue.","ecosystems":["Packagist"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Slow String Operations via MultiPart Requests in Event-Driven Functions","id":"CVE-2024-29186","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"denial_of_service","year":"2024"},"n_packages":2,"n_references":2,"next":{"headline":"WiX based installers are vulnerable to binary hijack when run as SYSTEM","id":"CVE-2024-29187"},"packages":[{"ecosystem":"Packagist","fixed":["2.1.17"],"introduced":["0"],"last_affected":[],"package":"bref/bref","purl":null,"source":"GHSA-j4hq-f63x-f39r"},{"ecosystem":"Packagist","fixed":["2.1.17"],"introduced":["0"],"last_affected":[],"package":"bref/bref","purl":"pkg:composer/bref/bref","source":"GHSA-j4hq-f63x-f39r"}],"prev":{"headline":"FreeScout OS Command Injection vulnerability","id":"CVE-2024-29185"},"products":["bref"],"published":"2024-03-22","related":[{"cvss_score":6.5,"headline":"Bref Uploaded Files Not Deleted in Event-Driven Functions","id":"CVE-2024-24752","kev_date_added":null,"published":"2024-02-01"},{"cvss_score":4.8,"headline":"Bref Multiple Value Headers Not Supported in ApiGatewayFormatV2","id":"CVE-2024-24753","kev_date_added":null,"published":"2024-02-01"},{"cvss_score":3.7,"headline":"Bref Body Parsing Inconsistency in Event-Driven Functions","id":"CVE-2024-24754","kev_date_added":null,"published":"2024-02-01"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-28","vendors":["brefphp"]},"summary":"Attackers can cause excessive CPU usage and billing costs in Bref PHP serverless functions by sending crafted multipart requests that trigger slow string operations.","url":"https://insights.sbomify.com/CVE-2024-29186/"}