Advisory

RUSTSEC-2019-0033

Also known as: CVE-2019-25008, CVE-2020-25574, GHSA-x7vr-c387-8w57, GHSA-xvc9-xwgj-4cq9

Summary

Integer Overflow in HeaderMap::reserve() can cause Denial of Service

Details

HeaderMap::reserve() used usize::next_power_of_two() to calculate the increased capacity.
However, next_power_of_two() silently overflows to 0 if given a sufficiently large number
in release mode.

If the map was not empty when the overflow happens,
the library will invoke self.grow(0) and start infinite probing.
This allows an attacker who controls the argument to reserve()
to cause a potential denial of service (DoS).

The flaw was corrected in 0.1.20 release of http crate.

Severity

High Basis: CVSS v3 score 7.5, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Dates

Published
2019-11-16 12:00 UTC
Modified
2023-11-08 04:01 UTC

Affected packages and fixes

http

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.1.20 (semver)

Fixed versions

0.1.20

Fix

  • Fixed version 0.1.20
    cargo update -p http --precise 0.1.20

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: RustSec Advisory Database · CC0-1.0

Sources & licences