Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport into 5.16] boto fix #8836

Merged
merged 3 commits into from
Feb 27, 2025

Conversation

liranmauda
Copy link
Contributor

Explain the changes

  1. Backport into 5.16

Issues: Fixed #xxx / Gap #xxx

  1. https://issues.redhat.com/browse/DFBUGS-1536
  2. https://issues.redhat.com/browse/DFBUGS-955

shirady and others added 2 commits February 27, 2025 09:31
…nkedContentDecoder)

1. In http_utils.js accept more types of content sha256 headers (STREAMING-UNSIGNED-PAYLOAD-TRAILER, STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER), as without those headers on clients that add the checksum headers with trailing we would fail.
2. Change the state of the machine and add more states to support the trailing headers: STATE_READ_TRAILER (like we have STATE_READ_CHUNK_HEADER), STATE_WAIT_NL_TRAILER (like we have STATE_WAIT_NL_DATA) and STATE_WAIT_NL_END.
3. Set the following constants to limit the request (avoid the client from abuse):
   - MAX_CHUNK_SIZE - we want to have a lower number than Number.MAX_SAFE_INTEGER (reference), we expect lower number.
   - MAX_CHUNK_HEADER_SIZE - we don't expect that long (as it is saved in memory during the parsing).
   - MAX_TRAILER_SIZE - same, in the example we saw it was about ~30 (x-amz-checksum-crc32:uOMGCw==).
   - MAX_TRAILERS - currently we saw the trailer of checksum (x-amz-checksum-crc32:uOMGCw==), we expect to have a few trailers in a request.
4. Refactor and organize - add comments with explanations about the state machine, add helper functions, add separation between the parts, rename chunk_header_str to chunk_header, add members related to trailers, add the member this.stream_pos which we use for validation.
5. Improve building the string (either this.chunk_header, and this.trailer) so we won't build it byte by byte, but only after we find the CR ('\r`).
6. Replace buffer slice function with subarray as the function slice was deprecated (see reference).

Co-authored-by: Guy Margalit <[email protected]>
Signed-off-by: shirady <[email protected]>
(cherry picked from commit 9b5cc89)
Signed-off-by: Danny Zaken <[email protected]>
(cherry picked from commit 5df7894)
- Bumping deps to avoid CVE (24/02/2025)

Signed-off-by: liranmauda <[email protected]>
(cherry picked from commit ecfb1a7)
(cherry picked from commit d5fc8c1)
@liranmauda liranmauda merged commit d85bb9b into noobaa:5.16 Feb 27, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants