{"id":"CVE-2026-33241","aliases":["CVE-2026-33241","GHSA-pp9r-xg4c-8j4x"],"related":[],"kind":"vulnerability","state":"published","title":"Salvo Affected by Denial of Service via Unbounded Memory Allocation in Form Data Parsing","summary":"Salvo is a Rust web framework. Prior to version 0.89.3, Salvo's form data parsing implementations (`form_data()` method and `Extractible` macro) do not enforce payload size limits before reading request bodies into memory. This allows attackers to cause Out-of-Memory (OOM) conditions by sending extremely large payloads, leading to service crashes and denial of service. Version 0.89.3 contains a patch.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Salvo is a Rust web framework. Prior to version 0.89.3, Salvo's form data parsing implementations (`form_data()` method and `Extractible` macro) do not enforce payload size limits before reading request bodies into memory. This allows attackers to cause Out-of-Memory (OOM) conditions by sending extremely large payloads, leading to service crashes and denial of service. Version 0.89.3 contains a patch.","source":"cvelist"},{"lang":"en","text":"## Summary\nSalvo's form data parsing implementations (`form_data()` method and `Extractible` macro) do not enforce payload size limits before reading request bodies into memory. This allows attackers to cause Out-of-Memory (OOM) conditions by sending extremely large payloads, leading to service crashes and denial of service.\n\n## Details\n### Vulnerability Description\nThree attack vectors exist in Salvo's form handling:\n\n1. **URL-encoded form data** (`application/x-www-form-urlencoded`)\n   - `Request::form_data()` calls `BodyExt::collect(body)` which reads the entire body into memory without size checking\n   - Affects handlers using `req.form_data().await` directly\n\n2. **Multipart form data** (`multipart/form-data`)\n   - Similar unbounded memory allocation during parsing\n   - Affects handlers processing multipart uploads\n\n3. **Extractible macro**\n   - `#[derive(Extractible)]` with `#[salvo(extract(default_source(from = \"body\")))]` internally calls `form_data()`\n   - Vulnerabilities propagate to all extractors using body sources\n\n### Root Cause\nThe `FormData::read()` implementation prioritizes convenience over safety by reading entire request bodies before validation. Even when `Request::payload_with_max_size()` is available, it's not automatically applied in the form parsing path.\n\n### PoC\n1. run `Extract data from request` example in readme.md in docker file with limited memory say 100mb.\n2. Send `application/x-www-form-urlencoded` OR `multipart/form-data` payload to the endpoint.\n3. The server process OOM-crashes, instead of returning 413 error.\n\n\n## Impact\n### Immediate Effects\n- **Service Unavailability**: Servers crash under memory pressure\n- **Resource Exhaustion**: Single request can consume all available memory\n- **Cascading Failures**: In containerized environments, OOM can affect other services\n\n### Attack Characteristics\n- **Low Cost**: Attacker needs minimal bandwidth (header only, body can be streamed)\n- **No Authentication**: Exploitable on public endpoints\n- **Difficult to Rate-Limit**: Traditional rate limiting may not prevent single large request\n- **Amplification**: Small network cost → large memory consumption\n\n### Real-World Scenarios\n1. Public API endpoints accepting form data\n2. User registration/profile update handlers\n3. File upload endpoints using multipart forms\n4. Any endpoint using `#[derive(Extractible)]` with body sources\n\n## Suggestion: Make Multipart File Upload Handling Explicit Opt-In\n\n### Problem Statement\n\nCurrently, Salvo's multipart form data parsing automatically handles file uploads without explicit developer intent. This creates several security and usability concerns:\n\n1. **Unintended File Storage**: Developers may unknowingly accept file uploads when they only intended to handle text fields\n2. **Disk Space Exhaustion**: Automatic file buffering to disk can fill storage without proper limits\n3. **Resource Cleanup**: Temporary files may not be properly cleaned up if handlers don't expect them\n4. **Attack Surface**: Endpoints inadvertently become file upload targets","format":"markdown","source":"ghsa"},{"lang":"es","text":"Salvo es un framework web de Rust. Antes de la versión 0.89.3, las implementaciones de análisis de datos de formulario de Salvo ('form_data()' método y 'Extractible' macro) no aplican límites de tamaño de carga útil antes de leer los cuerpos de las solicitudes en la memoria. Esto permite a los atacantes causar condiciones de falta de memoria (OOM) enviando cargas útiles extremadamente grandes, lo que lleva a caídas del servicio y denegación de servicio. La versión 0.89.3 contiene un parche.","source":"nvd"}],"published":"2026-03-19T12:44:56.000Z","modified":"2026-06-17T10:37:10.610Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":"< 0.89.3","status":"affected"}],"vendor":"salvo-rs","product":"salvo","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.89.3"}],"ecosystem":"crates.io","package":"salvo","purl":"pkg:cargo/salvo","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.89.3"}],"vendor":"salvo","product":"salvo","cpe":"cpe:2.3:a:salvo:salvo:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/salvo-rs/salvo/security/advisories/GHSA-pp9r-xg4c-8j4x","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/salvo-rs/salvo/releases/tag/v0.89.3","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33241","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/salvo-rs/salvo","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-03-25T19:22:09.920Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33241","url":"https://www.cve.org/CVERecord?id=CVE-2026-33241","licence":"CVE Terms of Use","modified":"2026-03-25T19:22:48.083Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pp9r-xg4c-8j4x","url":"https://github.com/advisories/GHSA-pp9r-xg4c-8j4x","licence":"CC-BY-4.0","modified":"2026-03-25T21:04:54.069Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33241","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33241","licence":"Public domain","modified":"2026-06-17T10:37:10.610Z"}],"updatedAt":"2026-11-25T22:59:16.512Z","epss":{"score":0.00598,"percentile":0.42728,"date":"2026-11-30T12:00:22.000Z"}}