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
p2p: session.doRequest should define what happens if the response headers were more than the requested amount else encounter an integer overflow and a DOS vector
#226
Open
odeke-em opened this issue
Oct 22, 2024
· 1 comment
looks very trusting hence suspicious because if the response headers were even off by just 1 extra, the value of remaining headers will overflow to uint64(-1) which is a very very large number. I suggest that we add a check to avoid this attack vector that could cause prepareRequests to consume large amounts of memory.
The condition len(h) > req.Amount shouldn't happen right now, but you're right—it could be error-prone. Adding an extra sanity check would be a good idea to prevent any potential issues
go-header/p2p/session.go
Line 232 in 18f0eb1
looks very trusting hence suspicious because if the response headers were even off by just 1 extra, the value of remaining headers will overflow to uint64(-1) which is a very very large number. I suggest that we add a check to avoid this attack vector that could cause prepareRequests to consume large amounts of memory.
Kindly cc-ing @Wondertan @walldiss @liamsi
The text was updated successfully, but these errors were encountered: