You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rate-limiter is called prior to application-level checks on request validity, so we should be careful to avoid integer overflow in its code, as it is operating on untrusted data.
This was briefly fixed for BlobsByRange requests on unstable when we implemented a size check during decoding, but will regress again when this PR is merged:
The fix that existed in unstable was coincidental, so I think it is better if we address the root cause and avoid overflowing integer arithmetic in the rate limiter altogether. We can probably replace most uses of +, -, * by their saturating_ equivalents to get the right semantics.
This issue is not deemed security-sensitive because other mechanisms exist to defend the node from peers that would bypass the rate limiter. Any request with an invalid count will be rejected by application-level checks and result in the peer being quickly banned.
Thanks to @gln for reporting this bug as part of the Immunefi Ethereum Attackathon.
The text was updated successfully, but these errors were encountered:
The rate-limiter is called prior to application-level checks on request validity, so we should be careful to avoid integer overflow in its code, as it is operating on untrusted data.
There is integer overflow here:
lighthouse/beacon_node/lighthouse_network/src/rpc/rate_limiter.rs
Lines 416 to 426 in 029b4f2
The
tokens
value is derived from untrusted user input:lighthouse/beacon_node/lighthouse_network/src/rpc/rate_limiter.rs
Lines 327 to 333 in 029b4f2
The
count
from the request is untrusted and can be set arbitrarily:lighthouse/beacon_node/lighthouse_network/src/rpc/protocol.rs
Lines 794 to 811 in 029b4f2
This was briefly fixed for
BlobsByRange
requests onunstable
when we implemented a size check during decoding, but will regress again when this PR is merged:The fix that existed in unstable was coincidental, so I think it is better if we address the root cause and avoid overflowing integer arithmetic in the rate limiter altogether. We can probably replace most uses of
+
,-
,*
by theirsaturating_
equivalents to get the right semantics.We can also enable the
arithmetic_side_effects
lint, which we use inconsensus
crates. See:This issue is not deemed security-sensitive because other mechanisms exist to defend the node from peers that would bypass the rate limiter. Any request with an invalid
count
will be rejected by application-level checks and result in the peer being quickly banned.Thanks to
@gln
for reporting this bug as part of the Immunefi Ethereum Attackathon.The text was updated successfully, but these errors were encountered: