* fix(security): harden RPC, proxies, egress DNS, and OIDC
Harden internode RPC authentication/quotas, trusted-proxy allowlisting,
protocol IAM policy conditions, outbound DNS egress pinning, and OIDC
redirect and HTTPS enforcement:
- Trusted proxies: replace broad private/link-local peer trust in simple
mode with the configured trusted-proxy allowlist (defaulting to
loopback-only) and update proxy integration coverage.
- Protocol gateways & FTPS: populate standard IAM condition keys
(SourceIp, SecureTransport, CurrentTime, EpochTime, UserAgent,
Referer, principal metadata) in gateway authorization and replace the
unchecked FTPS fallback IP parse with explicit connection context.
- Bucket listing RPC: fail closed with entry index diagnostics instead
of silently dropping malformed BucketInfo entries on encode/decode.
- Internode RPC streams & replay cache: add framed HMAC-SHA256 response
authentication with sequence/digest/EOF verification and
post-verification endpoint pinning for read_file_stream and walk_dir,
plus canonicalized per-peer entry and memory-budget replay cache
isolation.
- Outbound DNS egress: unify storage/tier, remote S3 replication
targets, on-demand migration HTTP, Azure Blob, GCS, Keystone, and OIDC
outbound checks onto OutboundPolicy and connection-time
OutboundDnsResolver (with redirect blocking on Keystone) to stop DNS
rebinding to loopback/link-local/metadata targets.
- OIDC redirects & transport security: trust forwarded scheme/host only
from verified trusted proxies, never reflect untrusted request headers
into STS credential or logout redirects, and reject plaintext http://
OIDC URLs for non-loopback hosts unless explicitly opted in via
RUSTFS_IDENTITY_OPENID_ALLOW_INSECURE_TRANSPORT.
Refs: rustfs/backlog#1470, rustfs/backlog#1473, rustfs/backlog#1472, rustfs/backlog#1506
* fix(egress): restrict GCS endpoints and restore tier compatibility
* ci: tighten the GCS error-format baseline
* fix(ci): stop sending deprecated policy field in s3-tests add-user
rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.
Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.
Refs: rustfs/backlog#1246
* fix(ci): fail S3 user provisioning on HTTP errors without logging responses
* fix(iceberg): reject repeated warehouses before validating bucket names
* test(ecstore): wait for relaxed writes on the foreground lane
* test(quota): isolate concurrent real-disk probes in CI
* test(ecstore): scope upload lock identity helper to its Linux test
* fix(oidc): preserve HTTPS in dynamic callbacks
* ci: allow cold builds to finish all fuzz binaries
* chore(deps): bump rustfs/gateway pin to b6007d13
* fix(ci): stop sending deprecated policy field in s3-tests add-user
rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.
Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.
Refs: rustfs/backlog#1246
* fix(ci): fail S3 user provisioning on HTTP errors without logging responses
* fix(iceberg): reject repeated warehouses before validating bucket names
* test(ecstore): wait for relaxed writes on the foreground lane
* test(quota): isolate concurrent real-disk probes in CI
* test(ecstore): scope upload lock identity helper to its Linux test
* ci: allow cold builds to finish all fuzz binaries
* test(security): expand authz, OIDC, table LIST, and audit coverage
Add end-to-end, integration, and property-based security regression suites
closing in-repo RustFS test gaps across authorization, table-bucket LIST
isolation, OIDC web-identity federation, streaming SigV4 chunks, multipart
checksum algebra, and auth-failure audit delivery:
- Add table-bucket LIST isolation E2E tests across ListObjectsV2,
ListObjectVersions, and ListMultipartUploads covering delimiter
CommonPrefixes, opaque cursor confidentiality, cursor-attack rejection,
and >1000-object all-hidden raw page traversal.
- Wire fast delete_authorization_test, table_list_isolation_test,
oidc_web_identity_e2e_test, and auth_failure_audit_test cases into
.config/nextest.toml e2e-smoke (updating e2e-smoke/e2e-full selection
digests and raising security-smoke-floor to 29).
- Expand delete_authorization_test with anonymous force-delete / spoofed
REPLICA denial and Object Lock (GOVERNANCE bypass, COMPLIANCE, Legal
Hold) enforcement regressions.
- Add OIDC AssumeRoleWithWebIdentity E2E matrix (E2E-01..E2E-13, multi-
audience, inline session-policy intersection) and rustfs-iam web-identity
integration tests (tampered payload, alg=none, HS256 confusion,
malformed/missing-iss tokens, OTHER_AUDIENCES, concurrent JWKS rotation,
multi-provider routing, refresh_token flow, and iat/exp/nbf boundaries).
- Add signed aws-chunked truncated-terminator and reordered-chunk negative
E2E tests (PutObject and UploadPart), multipart ETag-of-ETags and
COMPOSITE/FULL_OBJECT checksum proptests in rustfs-rio and rustfs-ecstore,
live audit webhook denial delivery tests (with honest characterization of
gateway SignatureDoesNotMatch auditing), and fuzz/proptest + GHSA
regression admission rules in AGENTS.md and adversarial-validation.md.
Refs: rustfs/backlog#2675, rustfs/backlog#2724, rustfs/backlog#1151
* test(security): bound listing checks and allow new audit events
* fix(ci): stop sending deprecated policy field in s3-tests add-user
rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.
Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.
Refs: rustfs/backlog#1246
* fix(ci): fail S3 user provisioning on HTTP errors without logging responses
* fix(iceberg): reject repeated warehouses before validating bucket names
* test(ecstore): wait for relaxed writes on the foreground lane
* test(quota): isolate concurrent real-disk probes in CI
* test(ecstore): scope upload lock identity helper to its Linux test
* ci: allow cold builds to finish all fuzz binaries
* fix(helm): provide writable temporary storage for scanner restores
Paged usage checkpoints larger than 1 MiB need a temporary file during restore. Mount a disk-backed emptyDir at /tmp in each RustFS pod and honor existing mounts on upgrade.
Fixes#9672
* fix(ci): stop sending deprecated policy field in s3-tests add-user
rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.
Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.
Refs: rustfs/backlog#1246
* fix(ci): fail S3 user provisioning on HTTP errors without logging responses
* fix(iceberg): reject repeated warehouses before validating bucket names
* test(ecstore): wait for relaxed writes on the foreground lane
* test(quota): isolate concurrent real-disk probes in CI
* test(ecstore): scope upload lock identity helper to its Linux test
* ci: allow cold builds to finish all fuzz binaries
* perf(ecstore): defer destination preflight on fused non-inline commits
Extend deferred destination preflight to non-inline fused rename_data commits on Linux, skip descriptor-cache part path construction and invalidation when committing inline objects, and use io_get_object_open_path for staged multipart data directories on Linux.
* fix(ecstore): gate can_defer_dst_preflight with cfg(target_os = "linux")
* fix(ecstore): settle already-applied delete markers
* fix(ci): stop sending deprecated policy field in s3-tests add-user
rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.
Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.
Refs: rustfs/backlog#1246
* fix(ci): fail S3 user provisioning on HTTP errors without logging responses
* fix(iceberg): reject repeated warehouses before validating bucket names
* test(ecstore): scope upload lock identity helper to its Linux test
(cherry picked from commit 72539d5991)
* ci: allow cold builds to finish all fuzz binaries
(cherry picked from commit 95e299b012)
---------
Co-authored-by: overtrue <anzhengchao@gmail.com>
An SSE-KMS write whose x-amz-server-side-encryption-aws-kms-key-id header
carries a plain key name behind an AWS-style ARN prefix
(arn:aws:kms:<name>) failed with 400 KMS.NotFoundException, because the
whole header value was looked up as the key name. Bucket replication from
a source that sends key names in that form therefore left every SSE-KMS
object FAILED.
The request header is now reduced to <name> when the remainder after the
prefix is a non-empty name without ':' or '/'. Complete key and alias ARNs
keep further ':'-separated fields and are passed on unchanged. The
reduction runs on the request's own value before it is merged with a
bucket default and before the KMS authorization check, so PutObject,
CopyObject and CreateMultipartUpload authorize, seal and record one key
id. A bucket default KMSMasterKeyID is still used as configured.
Skip empty-map probes in get_str, get_consistent_value, contains_key_str, and remove_str, remove redundant pre-retain HashMap::remove calls on ASCII suffixes in remove_str, and avoid String allocations in internal_key_starts_with and both_keys.
Pre-size MetaObject::meta_sys and MetaObject::meta_user in From<FileInfo> for MetaObject to avoid HashMap table reallocations, and pre-size marshal_msg buffers on ObjectPartInfo, MetaObject, FileMetaVersion, and MetaDeleteMarker.
Add a uniform-quorum fast path in resolve_read_part_from_responses to avoid HashMap allocations when disks agree on part metadata, avoid intermediate String and Vec allocations in get_multipart_sha_dir and get_upload_id_dir, and use Arc<str> and in-place prepared_disks return in SetDisks::rename_part.
Increase DEFAULT_GET_OBJECT_METADATA_CACHE_MAX_ENTRIES to 32,768 and GET_OBJECT_METADATA_CACHE_FENCE_SHARDS to 16,384, precompute and share Arc-backed shuffled non-inline metadata on GetObjectMetadataCacheEntry across GET reader paths, and insert SUFFIX_ACTUAL_SIZE into FileInfo before cloning per-replica metadata in SetDisks::put_object.
Scope has_clean_active_multipart_source to individual part numbers when checking part transactions and serialize unsettled_parts updates inside the part-transaction lock and SourceRW blocking closures.
Add has_active_multipart_source_matching so SetDisks::put_object_part can reuse the pre-commit upload head metadata in the commit stage when the upload commit guard is held, no size limit applies, and all active local drives match the cached upload data_dir and mod_time.
Coalesce empty <sha256> ancestor directory pruning into the same blocking operation as the multipart upload trash rename in LocalDisk::delete, reducing recursive multipart upload cleanup from two blocking-queue jobs per drive to one.
Reuse validated bucket/upload paths and pre-rename FileStamps during multipart metadata writes, add an in-memory data_dir-bound precheck in LocalDisk::read_parts before acquiring DiskIoPermit, and skip unused part cleanup vector construction in SetDisks::complete_multipart_upload when can_skip_part_cleanup is true.
Co-authored-by: Hauser Zhi <housemecn@gmail.com>
* perf(quota): reuse the v1 ledger lock during admission
Use the fenced ledger read for both the stale reservation check and
quota admission. Drop the ledger lock while probing operation owners,
then reload before applying recovery. Correlate v1 ledger acquisitions
across request and detached commit tasks.
Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>
* perf(quota): batch v1 commit markers and settlements
Share one fenced ledger load and durable save for pending mutations
on the same coordinator. Keep per-request acquisition budgets and
retain operation owners until persistence completes. Preserve isolated
mutation errors and the existing admission and crash boundaries.
Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>
* perf(quota): batch v1 admissions through the ledger executor
Apply pending admissions against one fenced balance and acknowledge
them after the shared durable save. Keep independent recovery for
abandoned operations and avoid reporting a speculative hard-cap
denial after a failed write. Share immutable reservation data across
detached stages without copying object and ledger keys.
Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>
* test(heal): wait for restored root completion handoff
Use the scheduler's test hook to wait for the terminal publication
attempt and active-task removal without polling against a five-second
wall-clock deadline. Verify the successful terminal receipt on disk
and that no pending recovery remains.
Co-Authored-By: heihutu <heihutu@gmail.com>
Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com>
---------
Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
Separate operator-configured HTTP(S) forward-proxy resolution from direct target DNS filtering in `rustfs_utils::egress` and wire OIDC HTTP clients through `OutboundPolicy::configure_reqwest_client`. Target OIDC URLs are always validated up front, direct and `NO_PROXY`/loopback connections retain connection-time target DNS filtering, and matched `HTTP_PROXY`/`HTTPS_PROXY`/`ALL_PROXY` hops permit private, shared, and loopback proxy addresses while keeping metadata, link-local, unspecified, translation, and reserved addresses (plus SOCKS schemes) blocked fail-closed. `OutboundPolicyError` preserves its exact target-policy shape alongside orthogonal `OutboundClientError`, and proxy rejections identify the proxy configuration without emitting misleading `RUSTFS_OUTBOUND_ALLOW_ORIGINS` hints for the OIDC provider origin.
Fixes#9611
Move the shuffled disk vector into completion and avoid creating an
unused token table when the quota mutation fence is inactive.
Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
Collect direct unary results from the detached JoinSet. Preserve
streamed delivery for batch, early ACK, and publication-scoped
operations, with the existing rollback and deadline handling.
Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
Co-authored-by: overtrue <anzhengchao@gmail.com>
Report the phase split and configured disk coordinates for a slow
direct unary slot. Reuse an available request trace ID across the
detached PUT commit without changing RPC metadata.
Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
Skip allocating empty scanner fence tables. Borrow the online disk
list for fully joined capacity accounting and borrow UTF-8 views for
local rename path validation.
Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
Avoid an all-empty token table and gate tail release captures on an
active quota mutation fence. Preserve the existing fence finalizer
and cancellation handling.
Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
Reuse the fanout disk vector after all producers join and write
quorum succeeds. Keep reuse ownership with the caller and drop it
before entering asynchronous rollback or recovery.
Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
An overwrite interrupted after publishing its metadata leaves the
replaced generation's backup, and its data directory, behind a live
successor. Delete recovery classified that residue as an ambiguous legacy
delete, so object heal failed before shard reconstruction on every retry
and the object stayed under-replicated.
A drive now reports a journal-less backup whose versions are all still
live, with the differing one replaced in place by a strictly newer
unversioned object. The report alone resolves nothing. Heal proceeds past
such residue only when the newest generation reached write quorum, and
discards the backups only once every drive holds identical live
metadata. The replaced parts are then reclaimed as plain orphan data
directories. Residue with delete evidence, versioned, tiered or
object-locked successors, and an uncommitted successor stay blocked.
Co-authored-by: hector <42570491+majinghe@users.noreply.github.com>
* test(security): add fuzzing, rejection mutants, and obs fault tests
Add sigv4_request and notify_xml libFuzzer targets with seed corpora and
unit tests, wire fuzz.yml as a workflow_call security-input-gate in CI
with trusted changed-path selection, and add fixed rejection-branch
mutation verification in isolated workspaces.
Verify #[path] coverage attribution with canonical path merging in
coverage_per_crate.py, sanitize OTLP startup endpoint logging, and add
connect_logs lease/fault regressions, local fake-OTLP 401/500/refused/
timeout/redaction tests, and E2E observability export failure isolation
tests.
Refs: rustfs/backlog#2677, rustfs/backlog#2679
* fix(ci): stop sending deprecated policy field in s3-tests add-user
rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.
Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.
Refs: rustfs/backlog#1246
* fix(ci): run called validation gates and count wrapped coverage lines
* fix(ci): fail S3 user provisioning on HTTP errors without logging responses
* fix(iceberg): reject repeated warehouses before validating bucket names
* test(ecstore): wait for relaxed writes on the foreground lane
* test(quota): isolate concurrent real-disk probes in CI
* ci: budget for cold instrumentation builds and validation rebuilds
* test(ecstore): scope upload lock identity helper to its Linux test
* test(ecstore): isolate namespace lock checks from runner disk latency
* test(ecstore): wait for inline source publication before reading a disk
* test(connect): isolate the durable receipt integration test
* fix(ecstore): remove staged heal data when the heal is dropped
A heal task that reaches its timeout, or is cancelled, has its storage heal future dropped in the middle of the data stage. The shards it had staged under its tmp prefix were only removed on the heal's own return paths, so a dropped heal left them on the outdated disks until the stale-tmp sweep a day later.
Add a guard that removes the staged prefix when the heal future is dropped during the data stage. It is disarmed once the heal has cleaned up itself and before the rename phase, so it never removes a prefix that is being renamed into place.
* test(ecstore): prove staged heal cleanup stops before the rename phase
Add a regression test for the disarm that precedes the rename phase: pause the physical rename of the first target, drop the heal future, and check that no staged-prefix removal was dispatched and that the detached rename still publishes a complete target. A test-only counter in the guard's Drop makes the dispatch observable.
The two tests share one fixture, and the staging test now also asserts exactly one dispatch.
* test(ecstore): gate heal rename test off Windows, observe publication
The rename test imports `prepared_publication_test_hooks`, which `disk/os.rs` compiles out on Windows, so the ecstore unit-test binary did not build there. Gate the test to the platforms that provide the hook, as the other users of the hook are.
The fixture removed the targets' shard directory and left their metadata head pointing at the data directory, so the wait for the detached rename was already satisfied before the rename ran. Start both targets without a metadata head, assert the paused target still has none while its rename is held, and wait for the head to appear before checking the data directory it names.
---------
Co-authored-by: Hauser Zhi <housemecn@gmail.com>
Co-authored-by: Chris An <anzhengchao@gmail.com>
* fix(ci): stop sending deprecated policy field in s3-tests add-user
rustfs/rustfs#9677 hardened /rustfs/admin/v3/add-user to fail closed when a non-empty deprecated policy field is provided. scripts/s3-tests/run.sh was still passing policy=readwrite in the add-user body even though it immediately calls set-user-or-group-policy right after, and awscurl returned exit 0 on XML <Error> responses so provisioning silently failed and broke all alt-user s3-tests.
Remove the deprecated policy field from the add-user payload, check awscurl responses for XML <Error> elements in provisioning, and add a regression unit test in scripts/s3-tests/test_runner_tools.py.
Refs: rustfs/backlog#1246
* fix(ci): fail S3 user provisioning on HTTP errors without logging responses
* fix(iceberg): reject repeated warehouses before validating bucket names
* test(ecstore): wait for relaxed writes on the foreground lane
* test(quota): isolate concurrent real-disk probes in CI
* test(ecstore): scope upload lock identity helper to its Linux test
* ci: allow cold builds to finish all fuzz binaries
openidconnect 4.1.0 is the only consumer of rsa 0.9.10 and has no
released rsa 0.10 build. Vendor that crate, retarget JWS verification
to rsa 0.10, and remove the exception that expired on 2026-07-31.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Chris An <overtrue@users.noreply.github.com>
Propagate verified proxy transport/client context and request-scoped
server context slots across admin authentication and authorization,
including task-scoped IAM root credential lookup so multi-instance
embedded servers do not leak ambient credentials across server domains.
Fail closed with InvalidArgument on non-empty AddOrUpdateUserReq.policy
in both the add-user admin handler and IamSys::create_user, normalizing
empty policy strings to None before persistence and site-replication
hooks.
Wrap GetKmsStatusHandler authorization denials in KmsAdminAudit::gate_admin
using KmsAdminOperation::Status, apply bucket-scoped authorization
symmetrically across bucket quota write and read handlers, and restore the
guardrail comment documenting direct is_allowed evaluation in
service_account.rs.
Enable bucket and object resource matching for scoped admin actions
(SetBucketQuota, GetBucketTarget, SetBucketTarget, InspectData) in the
policy evaluator and wire resource-scoped authorization into replication
remote-target and inspect-data handlers. Align bulk access-key routes on
ListUsersAdminAction for cross-user queries and enforce strict S3 bucket
name validation on quota and table-catalog warehouse parameters.
Refs: rustfs/backlog#1469, rustfs/backlog#1246, rustfs/backlog#1886, rustfs/backlog#2526
Port the scanner folder walker from #9623 onto current main so nested
directory polls no longer grow the worker stack. Keep later main
behavior for object metadata, lifecycle, heal discovery, and child
errors.
Refs rustfs/backlog#3293
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Chris An <overtrue@users.noreply.github.com>
Harden the Swift protocol layer across request body boundaries, storage
quotas, FormPost redirects, and server-side encryption:
- Bound control-plane and streaming request bodies at the HTTP frame and
decompression boundaries (bulk-delete, bulk-extract tar/gzip/bzip2,
FormPost multipart, SLO PUT) and cap bulk path/error/part/field counts.
- Enforce MAX_OBJECT_SIZE for unknown-length and mismatched-length object
uploads via a contract-safe streaming byte-cap reader, reject negative or
malformed Content-Length headers, and enforce container byte/count quotas
across PUT, bulk extract, FormPost, SLO, DLO, and COPY with serialized
in-flight reservations and immediate usage-overlay updates.
- Reject unauthenticated or expired FormPost requests with 401 without
issuing a redirect, validate signed redirect schemes, restrict unsigned
redirect_error targets to the signed redirect origin, and preserve binary
upload payloads losslessly.
- Honor bucket default SSE-S3/SSE-KMS on Swift writes (failing closed on
unreadable encryption config or missing Content-Length) and authorize
kms:Decrypt before DEK unwrap on Swift GET and COPY.
- Fix an unconditional SessionContext import in dummy_storage.rs so
rustfs-protocols compiles under both default and swift features.
Refs: rustfs/backlog#1471, rustfs/backlog#1474, rustfs/backlog#1473, rustfs/backlog#2702
Add .config/advisory-exceptions.toml (schema_version=1) and scripts/security/check_advisories.py to enforce pinned cargo-deny (0.20.2), advisory-db freshness (<=24h verified cache fallback), bidirectional deny.toml alignment, 90-day max UTC validity windows, exact version scope matching, and PR base-diff approval checks.
Wire security-advisories into ci.yml (ALWAYS_JOBS, required-checks, alert-on-failure, PLAN_CONTRACT=10), align daily audit.yml while preserving all four cargo-deny categories, and register --self-test in make script-tests.
Historical RUSTSEC-2023-0071 (transitive rsa 0.9.10 via openidconnect 4.1.0; direct rsa upgraded to patched 0.10.0 in PR #9492) retains its expired 2026-07 review window and intentionally fails closed until maintainer risk acceptance or upstream upgrade lands.
Refs: rustfs/backlog#2668
fix(gateway): harden post-cutover S3 auth, body limits, and context isolation
Address nine post-cutover parity and isolation regressions against rustfs/gateway:
- Keep expired STS sessions enabled in gateway-adapter so gateway returns 400 ExpiredToken (retiring c-cred-0020 ruling) while disabled/invalid STS and expired service accounts remain disabled.
- Remove pre-auth 20 MiB ControlBodyDigestService buffering from S3/gateway listeners, preserving console-listener route isolation via ConsoleListenerRouteService and post-auth SigV2 Content-MD5 checks on DeleteObjects and non-empty config PUTs.
- Stop copying unsigned wire x-amz-server-side-encryption* headers into PostObjectPolicyHeaders during preflight authorization.
- Source live_root() credentials and token signing key strictly from ServerContextSlot rather than process globals.
- Configure max_framed_upload_bytes(5 GiB) and upload_object_ceiling(5 GiB) on GatewayStack.
- Initialize S3 and ListObjects metrics on GatewayStack::assemble.
- Inject ServerContextSlot into NativeConsoleEdgeService request extensions.
- Scope ProtocolStorageClient is_owner and list_buckets IAM lookup to ServerContextSlot without breaking direct-write BucketGenerationGuard invariants.
- Wire verify_paths_double_encoded_under(TABLE_CATALOG_PREFIXES) in native admin, record 204 NO_CONTENT on PutBucketPolicy audit entries, and set explicit 500 status on HeadObject ErrMeta.
Update taiki-e/cache-cargo-install-action in .github/workflows/ci.yml to v3.0.8 (9ee83daaa7b96a6fab930949ecf1122bba04a389), which pins its nested actions/cache reference to commit SHA 55cc8345863c7cc4c66a329aec7e433d2d1c52a9 (v6.1.0).
This removes the sole unpinned nested composite action across all 39 unique third-party actions in the repository and unblocks enabling GitHub repository sha_pinning_required.
Refs: rustfs/backlog#1602