-
Notifications
You must be signed in to change notification settings - Fork 683
build(deps): bump s3s from 0.12.0-rc.4 to 0.12.0-rc.5 in the s3s group #1046
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
base: main
Are you sure you want to change the base?
Conversation
Bumps the s3s group with 1 update: [s3s](https://github.com/Nugine/s3s). Updates `s3s` from 0.12.0-rc.4 to 0.12.0-rc.5 - [Changelog](https://github.com/s3s-project/s3s/blob/main/CHANGELOG.md) - [Commits](s3s-project/s3s@v0.12.0-rc.4...v0.12.0-rc.5) --- updated-dependencies: - dependency-name: s3s dependency-version: 0.12.0-rc.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: s3s ... Signed-off-by: dependabot[bot] <support@github.com>
|
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
|
@copilot Analyze in depth the error prompts in the action, modify and improve the errors, and please start your repair and improvement process as a senior Rust architect. |
…ody size limits (#1061) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: houseme <4829346+houseme@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR bumps the s3s dependency from version 0.12.0-rc.4 to 0.12.0-rc.5, which introduces strongly-typed ETag handling for conditional request headers. The changes adapt the codebase to use the new as_strong() method for ETag validation and implement comprehensive request/response body size limits to prevent DoS attacks through unbounded memory allocation.
Key Changes:
- Updated ETag conditional header handling (If-Match, If-None-Match) to use strongly-typed ETags with
as_strong()validation across GetObject, HeadObject, PutObject, CompleteMultipartUpload, and CopyObject operations - Replaced all
store_all_unlimited()calls withstore_all_limited()using defined size constants (1MB-100MB depending on use case) to prevent memory exhaustion attacks - Improved error messages across admin handlers to provide clearer feedback when body size limits are exceeded
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
Cargo.toml |
Bumped s3s dependency version from 0.12.0-rc.4 to 0.12.0-rc.5 |
Cargo.lock |
Updated lock file with new s3s version checksum |
rustfs/src/storage/ecfs.rs |
Updated ETag conditional logic in GetObject, HeadObject, PutObject, CompleteMultipartUpload, and CopyObject to use as_strong() for strong ETag validation |
rustfs/src/admin/mod.rs |
Added constants module import |
rustfs/src/admin/constants.rs |
New file defining request body size limits for admin API endpoints (1MB-100MB) |
rustfs/src/admin/rpc.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE limit and improved error message |
rustfs/src/admin/handlers.rs |
Applied size limits to heal and remote target configuration endpoints |
rustfs/src/admin/handlers/user.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE and MAX_IAM_IMPORT_SIZE limits |
rustfs/src/admin/handlers/tier.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE limit with improved error messages |
rustfs/src/admin/handlers/sts.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE limit with improved error messages |
rustfs/src/admin/handlers/service_account.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE limit with improved error messages |
rustfs/src/admin/handlers/policies.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE limit with improved error message |
rustfs/src/admin/handlers/kms_keys.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE limit to KMS key operations |
rustfs/src/admin/handlers/kms_dynamic.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE limit to KMS configuration operations |
rustfs/src/admin/handlers/kms.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE limit to key generation operations |
rustfs/src/admin/handlers/group.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE limit with improved error message |
rustfs/src/admin/handlers/event.rs |
Applied MAX_ADMIN_REQUEST_BODY_SIZE limit to notification target configuration |
rustfs/src/admin/handlers/bucket_meta.rs |
Applied MAX_BUCKET_METADATA_IMPORT_SIZE limit with improved error message |
crates/ecstore/src/client/mod.rs |
Added body_limits module |
crates/ecstore/src/client/body_limits.rs |
New file defining MAX_S3_RESPONSE_SIZE (10MB) for remote S3 service responses |
crates/ecstore/src/client/transition_api.rs |
Applied MAX_S3_RESPONSE_SIZE limit to transition client error responses |
crates/ecstore/src/client/bucket_cache.rs |
Applied MAX_S3_RESPONSE_SIZE limit and removed unused imports |
crates/ecstore/src/client/api_list.rs |
Applied MAX_S3_RESPONSE_SIZE limit to list operations |
crates/ecstore/src/client/api_get_object_attributes.rs |
Applied MAX_S3_RESPONSE_SIZE limit and removed unused imports |
crates/ecstore/src/client/api_get_object_acl.rs |
Applied MAX_S3_RESPONSE_SIZE limit and removed unused imports |
docs/security/dos-prevention-body-limits.md |
New documentation file explaining DoS prevention rationale and implemented limits |
Comments suppressed due to low confidence (2)
rustfs/src/admin/handlers/user.rs:84
- This error message hasn't been updated like the other similar messages in this PR. For consistency with the other admin handler updates (e.g., sts.rs, tier.rs, service_account.rs), this should be updated to a more descriptive message.
Suggested change:
return Err(s3_error!(InvalidRequest, "user configuration body too large or failed to read")); let body = match input.store_all_limited(MAX_ADMIN_REQUEST_BODY_SIZE).await {
Ok(b) => b,
Err(e) => {
warn!("get body failed, e: {:?}", e);
return Err(s3_error!(InvalidRequest, "get body failed"));
crates/ecstore/src/client/bucket_cache.rs:219
- Multiple
.unwrap()calls in the chain can cause panics if any of the operations fail:
store_all_limited().unwrap()- panics if reading body fails or exceeds limitString::from_utf8().unwrap()- panics if body contains invalid UTF-8quick_xml::de::from_str().unwrap()- panics if XML parsing fails
This defeats the purpose of adding size limits for DoS prevention, as a malicious or misconfigured remote service could still cause panics.
Suggested fix:
let b = resp.body_mut().store_all_limited(MAX_S3_RESPONSE_SIZE).await.map_err(|e| {
error!("Failed to read location response body: {:?}", e);
std::io::Error::other("Failed to read location response")
})?.to_vec();
let mut location = "".to_string();
if tier_type == "huaweicloud" {
let d = quick_xml::de::from_str::<CreateBucketConfiguration>(&String::from_utf8_lossy(&b))
.map_err(|e| std::io::Error::other(format!("Failed to parse location response: {}", e)))?;
location = d.location_constraint;
} else {
if let Ok(LocationConstraint { field }) = quick_xml::de::from_str::<LocationConstraint>(&String::from_utf8_lossy(&b)) {
location = field;
}
} let b = resp.body_mut().store_all_limited(MAX_S3_RESPONSE_SIZE).await.unwrap().to_vec();
let mut location = "".to_string();
if tier_type == "huaweicloud" {
let d = quick_xml::de::from_str::<CreateBucketConfiguration>(&String::from_utf8(b).unwrap()).unwrap();
location = d.location_constraint;
} else {
if let Ok(LocationConstraint { field }) = quick_xml::de::from_str::<LocationConstraint>(&String::from_utf8(b).unwrap()) {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Bumps the s3s group with 1 update: s3s.
Updates
s3sfrom 0.12.0-rc.4 to 0.12.0-rc.5Commits
0e52387release v0.12.0-rc.5abfd2ccAdd tests for PUT presigned URL signature verification (#402)b0d16a0fix(s3s): fix unbounded memory allocation in http::body (#407)4752860feat(s3s): impl etag comparison (#410)fd56de9fix(s3s/sig_v4): update error message for x-amz-content-sha256 mismatch and h...a6446bffeat(s3s): use strongly typed ETag for conditional request headers (#403)0ed460efix(model): ignore EntityTooLarge 405aea9bd4build(deps): bump the dependencies group with 7 updates (#401)a073af1fix(s3s/ops): differentiate Get and List operations by id parameter (#392) (#...2c20f0bfix(s3s/http): prevent unbounded memory allocation in POST object (#370) (#390)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore <dependency name> major versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)@dependabot ignore <dependency name> minor versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)@dependabot ignore <dependency name>will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)@dependabot unignore <dependency name>will remove all of the ignore conditions of the specified dependency@dependabot unignore <dependency name> <ignore condition>will remove the ignore condition of the specified dependency and ignore conditions