[🐸 Frogbot] Update version of google.golang.org/grpc to 1.58.3 #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📦 Vulnerable Dependencies
✍️ Summary
High
github.com/spf13/viper:v1.17.0
google.golang.org/grpc:v1.58.2
[1.57.1]
[1.58.3]
🔬 Research Details
Description:
The HTTP (Hypertext Transfer Protocol) is a fundamental protocol of the World Wide Web, enabling the exchange of data between a client (typically a web browser) and a server. It defines the rules for requesting and transmitting web pages and other resources over the internet. Request and response messages are exchanged as a stream of ASCII characters, sent over a reliable transport layer like TCP.
HTTP/2 is a modern network protocol designed to improve the performance and efficiency of web communication. It replaces the older HTTP/1.1 protocol and introduces features like header compression and enhanced request cancellation mechanisms, which collectively enhance the speed and responsiveness of websites.
This request cancellation mechanism allows clients to terminate unnecessary or redundant requests without waiting for a server's response, reducing network congestion and further improving the overall responsiveness of web applications.
HTTP/2 resolves numerous concerns found in HTTP/1.1 by organizing each HTTP message into a series of HTTP/2 frames. These frames include type, length, flags, stream identifier (ID), and payload. The stream ID is essential in clearly associating specific bytes on the network with their corresponding messages, facilitating secure multiplexing and concurrent processing. These streams are bidirectional, enabling clients to transmit frames, and servers to respond with frames using the same ID.
As detailed in this technical analysis, there's a vulnerability in the way request cancellation is implemented. The flaw lies in the process of sending an excessive number of requests (specifically,
HEADERS
frames), each immediately followed by a request cancellation frame utilizing theRST_STREAM
frame. This sequence rapidly leads to a substantial consumption of server-side resources. Consequently, this vulnerability amplifies the risk of Distributed Denial of Service (DDoS) attacks, making it easier to overwhelm and exhaust the server's available resources.A lot of server applications are vulnerable to the Http/2 Rapid Reset attack.
However, note that HTTP/2 must be enabled, which is not the default configuration on most applications (excluding nghttp2 for example).
A non-exhaustive list of these vulnerable web applications:
Remediation:
Development mitigations
For netty:
Development mitigations
For Golang:
The default stream concurrency limit in
golang
is250 streams (requests) per HTTP/2 connection
. This value may be adjusted in thegolang.org/x/net/http2
package using theServer.MaxConcurrentStreams
setting and theConfigureServer
function which are available ingolang.org/x/net/http2
.Development mitigations
For Nghttp2:
Implement
nghttp2_on_frame_recv_callback
callback function, and check and countRST_STREAM
frames. If an excessive number ofRST_STREAM
frames are received, then take action, such as dropping the connection silently, or callingnghttp2_submit_goaway
and gracefully terminate the connection.Deployment mitigations
For NGINX:
Disabling HTTP/2 in NGINX is not necessary. Simply ensure you have configured:
keepalive_requests
should be kept at the default setting of 1000 requestshttp2_max_concurrent_streams
should be kept at the default setting of 128 streamslimit_conn
andlimit_req
should be set "with a reasonable setting balancing application performance and security"Deployment mitigations
A possible mitigation is to limit the maximum number of requests that can be made over a single keep-alive connection.
🐸 JFrog Frogbot