Advisory

GHSA-m77f-652q-wwp4

Also known as: CVE-2022-3212, RUSTSEC-2022-0055

Summary

axum-core has no default limit put on request bodies

Details

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

Severity

High Basis: The source's own band: HIGH

Dates

Published
2022-09-15 03:25 UTC
Modified
2023-11-08 04:09 UTC

Affected packages and fixes

axum-core

crates.io · All systems

Affected

  • introduced 0, fixed 0.2.8 (semver)

Fixed versions

0.2.8

Fix

  • Fixed version 0.2.8
    cargo update -p axum-core --precise 0.2.8

axum-core

crates.io · All systems

Affected

  • introduced 0.3.0-rc.1, fixed 0.3.0-rc.2 (semver)

Fixed versions

0.3.0-rc.2

Fix

  • Fixed version 0.3.0-rc.2
    cargo update -p axum-core --precise 0.3.0-rc.2

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences