GHSA-x7vr-c387-8w57

Suggest an improvement
Source
https://github.com/advisories/GHSA-x7vr-c387-8w57
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/08/GHSA-x7vr-c387-8w57/GHSA-x7vr-c387-8w57.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-x7vr-c387-8w57
Aliases
Related
Published
2021-08-25T21:01:31Z
Modified
2023-11-08T04:01:32.294723Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Integer Overflow/Infinite Loop in the http crate
Details

HeaderMap::reserve() used usize::nextpoweroftwo() to calculate the increased capacity. However, nextpoweroftwo() 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.

Database specific
{
    "nvd_published_at": "2020-09-14T19:15:00Z",
    "cwe_ids": [
        "CWE-190",
        "CWE-835"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2021-07-26T18:47:31Z"
}
References

Affected packages

crates.io / http

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.1.20

Ecosystem specific

{
    "affected_functions": [
        "http::header::HeaderMap::reserve"
    ]
}