Tokio rate limit: gRPC `IpKeyExtractor` keys on client-supplied forwarding headers
Affects tokio-rate-limitSource GCVE Database
CVSS 5.3 Medium : upgrade to 0.11.1 when convenient.
Data as of 20 Nov 2026, 13:42 UTC
- Patch
- Available – fixed in 0.11.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LWhat to do
Upgrade tokio-rate-limit to 0.11.1.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
crates.iotokio-rate-limitpkg:cargo/tokio-rate-limitOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available in version 0.11.1, which fixes the issue by using server-supplied connection information and ignoring untrusted forwarding headers by default. Deployments behind trusted proxies can use the new `ForwardedIpKeyExtractor` to safely handle forwarding headers. If upgrading is not possible, users should implement a custom key extractor that reads the verified peer IP from tonic's connection info and rejects requests without verified peer addresses. Alternatively, restrict backend access to trusted proxies that strip all incoming `x-forwarded-for` and `x-real-ip` headers and set a single verified `x-forwarded-for` header per request.
Description
The Tokio rate limit vulnerability involves the `tonic_middleware::IpKeyExtractor` component, which is intended to rate limit gRPC requests by client IP address. However, in versions 0.5.0 through 0.11.0, it relies on client-supplied `x-forwarded-for` and `x-real-ip` headers to determine the client IP, allowing attackers to bypass per-IP rate limits by manipulating these headers. Version 0.11.1 fixes this by using server-supplied connection information instead of untrusted headers. Deployments behind trusted proxies can opt-in to a new extractor that safely reads forwarding headers. Without upgrading, mitigations include using a custom key extractor or restricting backend access to trusted proxies that sanitize forwarding headers.