Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2688

ByteRange parser incorrectly accepts "bytes=-0" violating RFC 9110

XMLWordPrintable

      The ByteRange.parse() method in io.undertow.util.ByteRange incorrectly accepts suffix-range specifications with zero suffix-length (e.g., bytes=-0), which violates RFC 9110.

      ```

      For a GET request, a valid bytes range-spec is satisfiable if it is either:

      • an int-range with a first-pos that is less than the current length of the selected representation or
      • a suffix-range with a non-zero suffix-length"

      ```

      This leads to -0 being accepted as a valid range and us returning content of range length 0 and size 0 as we skip the check here -

              rhn-cservice-bbaranow Bartosz Baranowski
              prafgup Praful Gupta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: