CVE-2022-3212
JSON

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 packageVersionsReported by
tokio-rs axum-core0.3.0-rc.1, from unspecified before 0.2.8CVE 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.8GitHub Advisory Database, RustSec Advisory Database
axum-core_project axum-corebefore 0.2.8, 0.3.0NVD

All scores

JFROG7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD7.5high CVSS:3.1CVSS: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::Form
  • axum::extract::Json
  • String

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

Sources

SourceRecordLicence
CVE ListCVE-2022-3212 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-m77f-652q-wwp4 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2022-0055 changed 2023-11-08CC0-1.0
NVDCVE-2022-3212 changed 2026-06-17Public domain