mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-29 05:24:22 +00:00
* Reject long sequences of CONTINUATION frames Motivation: Long sequences of CONTINUATION frames can be used to mount attacks by attempting to get a remote peer to consume large amounts of memory. Modifications: - Add a limit to the number of sequential CONTINUATION frames that can be received. This limit is configurable by users at the NIOHTTP2Handler level and has a default value of 5. When this limit is exceeded, the recipient responds with a GOAWAY frame and an "Enhance Your Calm" error of a newly created type `ExcessiveContinuationFrames`. Result: Long sequences of CONTINUATION frames are now rejected by the recipient. * Refactor implementation * Minor adjustments * Implement adjustments - Refactor implementation - Revert unnecessary diffs * Implement adjustments - Change `public let maximumSequentialContinuationFrames` to `public var`. - Refactor implementation. * Implement minor adjustments * Store the default `maximumSequentialContinuationFrames` in a `private static let` --------- Co-authored-by: George Barnett <gbarnett@apple.com>