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
{{ message }}
Repository navigation
A Content-Length of 2^63 or more is accepted, then framed as no body #61
The validator accepts Content-Length values up to ulong.MaxValue: SemIsValidContentLengthValue (UltraHardenedParser.FullHeader.ROM.cs:371) compares 20-digit values against "18446744073709551615" (:410). The framing parse, though, accumulates in a signed long and gives up on overflow:
DetectBodyFraming then turns that -1 into NoBody (:52, :56):
Content-Length:
accepted
DetectBodyFraming
9223372036854775807
yes
ContentLength 9223372036854775807
9223372036854775808
yes
None
18446744073709551615
yes
None
Why it matters
As in #60, the body is read as the next request. A front end that takes the header at its word, waiting for the body or refusing it, disagrees with the back end about where the request ends. A header the parser accepted should never be framed as no body.
Responses share the parse: DetectResponseBodyFraming returns UntilClose for Content-Length: 9223372036854775808 (:131).
Fix
Either refuse these values (413), or frame them as long.MaxValue, which a server then refuses as too large instead of reading past it. Ktron's Kotlin port does the latter, in MDA2AV/Ktron@c6504d6.
main (f5d2cc1) and the NuGet package 0.3.7 both give the table above.
Activity