Skip to content
FlawDB
Sign in

GHSA-r5c9-r265-ccg3

UNSCORED

gRPC `IpKeyExtractor` keys on client-supplied forwarding headers

Also known as RUSTSEC-2026-0584

Mitigation

  • Upgrade tokio-rate-limit to 0.11.1 or later.

Who should check

  • Projects that depend on crates.io package tokio-rate-limit (>= 0.5.0, < 0.11.1)

Vulnerability facts

Affected
tokio-rate-limit >= 0.5.0, < 0.11.1
Fixed in
0.11.1
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Unknown
CVSS
Not scored yet
Published
Modified

Description

`tonic_middleware::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 `.fail_open()` 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 and fixed versions

Package / productAffectedFixedSource
crates.io tokio-rate-limit>= 0.5.0, < 0.11.10.11.1osv

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by GHSA-r5c9-r265-ccg3. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/GHSA-r5c9-r265-ccg3.md
Affected: tokio-rate-limit >= 0.5.0, < 0.11.1
Fixed in: 0.11.1

Steps:
1. Search this machine and project for tokio-rate-limit (crates.io): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

Technologies

References

FAQ

Is GHSA-r5c9-r265-ccg3 being exploited?

There is no confirmed exploitation: GHSA-r5c9-r265-ccg3 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

How serious is GHSA-r5c9-r265-ccg3?

It has no CVSS score yet. Unknown.

Which versions are affected by GHSA-r5c9-r265-ccg3?

tokio-rate-limit >= 0.5.0, < 0.11.1.

Is there a fix for GHSA-r5c9-r265-ccg3?

Yes. Fixed in 0.11.1. Upgrade tokio-rate-limit to 0.11.1 or later.

How do I check if I'm affected by GHSA-r5c9-r265-ccg3?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors