7.5high
DoS in axum-core due to missing request size limit
- Severity
- 7.5high CVSS:3.1 by JFROG
- Exploit likelihood
- 1.05% (higher than 65% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- JFROG
- Also known as
- GHSA-m77f-652q-wwp4RUSTSEC-2022-0055
Description
<bytes::Bytes as axum_core::extract::FromRequest>::from_request would not, by default, set a limit for the size of the request body. That meant if a malicious peer would send a very large (or infinite) body your server might run out of memory and crash. This also applies to these extractors which used Bytes::from_request internally: axum::extract::Form axum::extract::Json String
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| tokio-rs axum-core | 0.3.0-rc.1, from unspecified before 0.2.8 | CVE List |
| axum-core (crates.io) | before 0.2.8, from 0.3.0-rc.1 before 0.3.0-rc.2, from 0.0.0-0 before 0.2.8 | GitHub Advisory Database, RustSec Advisory Database |
| axum-core_project axum-core | before 0.2.8, 0.3.0 | NVD |
All scores
| JFROG | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
What each source says
CVE List
<bytes::Bytes as axum_core::extract::FromRequest>::from_request would not, by default, set a limit for the size of the request body. That meant if a malicious peer would send a very large (or infinite) body your server might run out of memory and crash. This also applies to these extractors which used Bytes::from_request internally: axum::extract::Form axum::extract::Json String
GitHub Advisory Database
<bytes::Bytes as axum_core::extract::FromRequest>::from_request would not, by default, set a limit for the size of the request body. That meant if a malicious peer would send a very large (or infinite) body your server might run out of memory and crash.
This also applies to these extractors which used Bytes::from_request internally:
axum::extract::Formaxum::extract::JsonString
The fix is also in axum-core 0.3.0.rc.2 but 0.3.0.rc.1 is vulnerable.
Because axum depends on axum-core it is vulnerable as well. The vulnerable versions of axum are <= 0.5.15 and 0.6.0.rc.1. axum >= 0.5.16 and >= 0.6.0.rc.2 does have the fix and are not vulnerable.
The patched versions will set a 2 MB limit by default.
NVD (es)
(bytes::Bytes como axum_core::extract::FromRequest)::from_request no establecía, por defecto, un límite para el tamaño del cuerpo de la petición. Esto significaba que si un compañero malicioso enviaba un cuerpo muy grande (o infinito) su servidor podría quedarse sin memoria y colapsar. Esto también se aplica a estos extractores que usan Bytes::from_request internamente: axum::extract::Form axum::extract::Json String
References
| https://research.jfrog.com/vulnerabilities/axum-core-dos/ | exploit, third-party-advisory | |
| https://rustsec.org/advisories/RUSTSEC-2022-0055.html | advisory, exploit, issue-tracking, patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-3212 | advisory | |
| https://github.com/tokio-rs/axum/pull/1346 | web | |
| https://github.com/tokio-rs/axum | package | |
| https://crates.io/crates/axum-core | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-3212 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-m77f-652q-wwp4 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2022-0055 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2022-3212 changed 2026-06-17 | Public domain |