Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. axum-core
  4. ›
  5. CVE-2022-3212

CVE-2022-3212: axum-core has no default limit put on request bodies

September 15, 2022 (updated September 19, 2022)

<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.

References

  • github.com/advisories/GHSA-m77f-652q-wwp4
  • github.com/tokio-rs/axum
  • github.com/tokio-rs/axum/pull/1346
  • nvd.nist.gov/vuln/detail/CVE-2022-3212
  • rustsec.org/advisories/RUSTSEC-2022-0055.html

Code Behaviors & Features

Detect and mitigate CVE-2022-3212 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.2.8, all versions starting from 0.3.0-rc.1 before 0.3.0-rc.2, version 0.3.0-rc.1

Fixed versions

  • 0.2.8
  • 0.3.0-rc.2

Solution

Upgrade to versions 0.2.8, 0.3.0-rc.2 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-770: Allocation of Resources Without Limits or Throttling

Source file

cargo/axum-core/CVE-2022-3212.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:04 +0000.