Repository navigation
fix(dataset): enforce max file size for multipart upload - #4146
Merged
Merged
Conversation
Contributor
Author
Contributor
xuang7
approved these changes
Jan 7, 2026
aicam
requested changes
Jan 7, 2026
aicam
left a comment
Contributor
There was a problem hiding this comment.
I think life cycle of upload session records needs better design, if needed, we can meet
aicam
enabled auto-merge (squash)
January 19, 2026 21:05
aicam
approved these changes
Jan 19, 2026
aicam
left a comment
Contributor
There was a problem hiding this comment.
LGTM!, thanks for the great PR
auto-merge was automatically disabled
January 19, 2026 22:01
Head branch was pushed to by a user without write access
Signed-off-by: carloea2 <[email protected]>
Contributor
Author
|
@aicam Can you run the testing? Thanks |
aicam
enabled auto-merge (squash)
January 19, 2026 23:56
madisonmlin
pushed a commit
to madisonmlin/texera
that referenced
this pull request
Mar 10, 2026
### What changes were proposed in this PR? * **Enforce the `single_file_upload_max_size_mib` limit for multipart uploads at init** by requiring `fileSizeBytes` + `partSizeBytes` and rejecting when the total declared file size exceeds the configured max. * **Persist multipart sizing metadata in DB** by adding `file_size_bytes` and `part_size_bytes` to `dataset_upload_session`, plus constraints to keep them valid. * **Harden `uploadPart` against size bypasses** by computing the expected part size from the stored session metadata and rejecting any request whose `Content-Length` does not exactly match the expected size (including the final part). * **Add a final server-side safety check at finish**: after lakeFS reports the completed object size, compare to the max and roll back the object if it exceeds the limit. * **Update frontend init call** to pass `fileSizeBytes` and `partSizeBytes` when initializing multipart uploads. * **Add DB migration** (`sql/updates/18.sql`) to apply the schema change on existing deployments. ### Any related issues, documentation, discussions? Close apache#4147 ### How was this PR tested? * Added/updated unit tests for multipart upload validation and malicious cases, including: * max upload size enforced at init (over/equals boundaries + 2-part boundary) * header poisoning and `Content-Length` mismatch rejection (non-numeric/overflow/mismatch) * finish rollback when max is tightened before finish (oversized object must not remain accessible) ### Was this PR authored or co-authored using generative AI tooling? Co-authored-by: ChatGPT --------- Signed-off-by: carloea2 <[email protected]> Co-authored-by: Chen Li <[email protected]>
SarahAsad23
pushed a commit
to madisonmlin/texera
that referenced
this pull request
May 20, 2026
### What changes were proposed in this PR? * **Enforce the `single_file_upload_max_size_mib` limit for multipart uploads at init** by requiring `fileSizeBytes` + `partSizeBytes` and rejecting when the total declared file size exceeds the configured max. * **Persist multipart sizing metadata in DB** by adding `file_size_bytes` and `part_size_bytes` to `dataset_upload_session`, plus constraints to keep them valid. * **Harden `uploadPart` against size bypasses** by computing the expected part size from the stored session metadata and rejecting any request whose `Content-Length` does not exactly match the expected size (including the final part). * **Add a final server-side safety check at finish**: after lakeFS reports the completed object size, compare to the max and roll back the object if it exceeds the limit. * **Update frontend init call** to pass `fileSizeBytes` and `partSizeBytes` when initializing multipart uploads. * **Add DB migration** (`sql/updates/18.sql`) to apply the schema change on existing deployments. ### Any related issues, documentation, discussions? Close apache#4147 ### How was this PR tested? * Added/updated unit tests for multipart upload validation and malicious cases, including: * max upload size enforced at init (over/equals boundaries + 2-part boundary) * header poisoning and `Content-Length` mismatch rejection (non-numeric/overflow/mismatch) * finish rollback when max is tightened before finish (oversized object must not remain accessible) ### Was this PR authored or co-authored using generative AI tooling? Co-authored-by: ChatGPT --------- Signed-off-by: carloea2 <[email protected]> Co-authored-by: Chen Li <[email protected]>
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
### What changes were proposed in this PR? * **Enforce the `single_file_upload_max_size_mib` limit for multipart uploads at init** by requiring `fileSizeBytes` + `partSizeBytes` and rejecting when the total declared file size exceeds the configured max. * **Persist multipart sizing metadata in DB** by adding `file_size_bytes` and `part_size_bytes` to `dataset_upload_session`, plus constraints to keep them valid. * **Harden `uploadPart` against size bypasses** by computing the expected part size from the stored session metadata and rejecting any request whose `Content-Length` does not exactly match the expected size (including the final part). * **Add a final server-side safety check at finish**: after lakeFS reports the completed object size, compare to the max and roll back the object if it exceeds the limit. * **Update frontend init call** to pass `fileSizeBytes` and `partSizeBytes` when initializing multipart uploads. * **Add DB migration** (`sql/updates/18.sql`) to apply the schema change on existing deployments. ### Any related issues, documentation, discussions? Close apache#4147 ### How was this PR tested? * Added/updated unit tests for multipart upload validation and malicious cases, including: * max upload size enforced at init (over/equals boundaries + 2-part boundary) * header poisoning and `Content-Length` mismatch rejection (non-numeric/overflow/mismatch) * finish rollback when max is tightened before finish (oversized object must not remain accessible) ### Was this PR authored or co-authored using generative AI tooling? Co-authored-by: ChatGPT --------- Signed-off-by: carloea2 <[email protected]> Co-authored-by: Chen Li <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this PR?
single_file_upload_max_size_miblimit for multipart uploads at init by requiringfileSizeBytes+partSizeBytesand rejecting when the total declared file size exceeds the configured max.file_size_bytesandpart_size_bytestodataset_upload_session, plus constraints to keep them valid.uploadPartagainst size bypasses by computing the expected part size from the stored session metadata and rejecting any request whoseContent-Lengthdoes not exactly match the expected size (including the final part).fileSizeBytesandpartSizeByteswhen initializing multipart uploads.sql/updates/18.sql) to apply the schema change on existing deployments.Any related issues, documentation, discussions?
Close #4147
How was this PR tested?
Added/updated unit tests for multipart upload validation and malicious cases, including:
Content-Lengthmismatch rejection (non-numeric/overflow/mismatch)Was this PR authored or co-authored using generative AI tooling?
Co-authored-by: ChatGPT