RUSTSEC-2026-0584: gRPC `IpKeyExtractor` keys on client-supplied forwarding headers

Published Nov 19, 2026
·
Updated

tonicmiddleware::IpKeyExtractor is documented as rate limiting gRPC requests by client IP address, but on a standard tonic server it keys on client-supplied x-forwarded-for and x-real-ip headers. In 0.5.0–0.9.1, the extractor reads those headers directly; in 0.10.0–0.11.0, it first checks for a bare std::net::SocketAddr request extension—which tonic::transport::Server never supplies, as it provides TcpConnectInfo instead—and falls back to the same headers. Direct clients can therefore choose their rate-limit key to bypass per-IP rate limits and increase the number of tracked keys; without forwarding headers, 0.5.0–0.9.1 allow requests without limiting them and 0.10.0–0.11.0 reject them by default unless .failopen() is enabled.

Applications are affected if they use GrpcRateLimitLayer with IpKeyExtractor (the tonic-support feature). The HTTP middleware's IpKeyExtractor reads ConnectInfo<SocketAddr> and is not affected.

Version 0.11.1 fixes IpKeyExtractor to honor a server-supplied SocketAddr override first and then read the TCP peer address from tonic's TcpConnectInfo (which tonic::transport::Server attaches to plaintext connections and connections using its built-in TLS), without ever reading forwarding headers. Deployments behind a trusted proxy can use the new opt-in ForwardedIpKeyExtractor, which reads a single configured header (x-forwarded-for or x-real-ip) and is only correct when that proxy sets the header as documented.

If you cannot upgrade to 0.11.1, use a custom key extractor that reads the peer IP from tonic's connection information for the transport in use (including TLS) and rejects requests without a verified peer address before invoking the limiter, or restrict backend access to a trusted proxy that strips all incoming x-forwarded-for and x-real-ip fields and sets one x-forwarded-for value to the verified client IP on every request.

Affected Software

1 affected componentFixes available
rust/tokio-rate-limit>=0.5.0<0.11.1
0.11.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rust/tokio-rate-limit to a version that resolves this vulnerability.

    Fixed in 0.11.1
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 0.11.1
  3. Configuration

    For deployments behind a trusted proxy, opt in to ForwardedIpKeyExtractor and configure it to read the forwarding header that the proxy sets.

    gRPC rate limiter IP key extractor = ForwardedIpKeyExtractor
  4. Compensating control

    If you cannot upgrade to 0.11.1, use a custom key extractor that reads the peer IP from tonic's connection information for the transport in use, including TLS, and rejects requests without a verified peer address before invoking the limiter.

  5. Compensating control

    Restrict backend access to a trusted proxy that strips incoming x-forwarded-for and x-real-ip fields and sets x-forwarded-for to the verified client IP on every request.

Event History

Nov 19, 2026
Advisory Published
via OSV·12:00 PM
Data Sourced
via OSV·12:00 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Which deployments are affected?

Applications are affected when they use GrpcRateLimitLayer with IpKeyExtractor and the tonic-support feature. The HTTP middleware's IpKeyExtractor is not affected because it uses ConnectInfo<SocketAddr>.

2

Can an unauthenticated remote client bypass the per-IP limit?

Yes. A direct client can supply x-forwarded-for or x-real-ip values to choose its rate-limit key, allowing it to evade per-IP rate limiting and increase the number of tracked keys.

3

How do versions behave when clients omit forwarding headers?

In versions 0.5.0 through 0.9.1, requests without forwarding headers are allowed without limiting. In versions 0.10.0 through 0.11.0, such requests are rejected by default unless fail_open() is enabled.

4

What version fixes the issue?

Version 0.11.1 fixes the extractor to prefer a server-supplied SocketAddr override and otherwise use the TCP peer address from tonic's TcpConnectInfo.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203