Repository navigation
fix: enforce retention authorization and immutable version writes - #234
Merged
Merged
Conversation
Close SN-2026-015 by requiring PutObjectRetention with request-derived condition keys before reading bucket or object state. Weakening unexpired GOVERNANCE retention also requires the bypass header and permission. Treat retention removal as zero remaining days and avoid duration saturation for distant dates. Close SN-2026-016 by requiring replication trust for caller-selected target version IDs and checking persisted multipart targets and locked null versions under the destination write lock, including across storage pools. Preserve versioning transitions, trusted replication and batch Snowball version IDs, and fail closed when lock state cannot be read. Add authorization, concurrent lock-update, multipart transition, cross-pool, configuration-failure and retention-boundary regression coverage. Validate with make test, focused race tests and the original independent probes. Developed with Codex (Astra). Co-authored-by: Codex <[email protected]> Signed-off-by: Feng Ruohang <[email protected]> (cherry picked from commit fe3935476b929e03193d7496a7448d760e635096)
Use the October security fixes for reachable standard-library and HTTP/2 vulnerabilities found by govulncheck. Align the module requirement, build dependency check and digest-pinned Docker build stages on Go 1.27.2. Update only golang.org/x/net and its checksums; module tidying and credit regeneration introduce no other dependency or license changes. Developed with Codex (Astra). Co-authored-by: Codex <[email protected]> Signed-off-by: Feng Ruohang <[email protected]>
Pin golangci-lint v2.14.0, whose x/tools v0.50.0 decoder supports the version 5 export data emitted by Go 1.27.2. The previous v2.13.1 binary failed to import internal/cpu in Linux CI before running the checks. Keep the existing linter selection and configuration. Developed with Codex (Astra). Co-authored-by: Codex <[email protected]> Signed-off-by: Feng Ruohang <[email protected]>
This was referenced Oct 24, 2026
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.
Description
Close SN-2026-015 and SN-2026-016. A bypass header can no longer substitute for retention authorization, and ordinary S3 writes can no longer replace a caller-selected version or a locked null version in place.
Require request-derived retention policy checks before bucket/object lookup, with a separate bypass permission for weakening active GOVERNANCE retention. Evaluate retention removal as zero days and avoid duration saturation for distant dates. Recheck null-version locks and persisted multipart targets under the destination write lock, including across pools and bucket versioning transitions.
Motivation and Context
The inherited retention helper allowed unauthorized retention changes. Public destination version IDs and multipart completion also allowed existing versions to be overwritten. These checks close the authorization, concurrency and versioning-transition gaps together.
Design and compatibility details: English, Chinese.
A separate build commit updates Go to 1.27.2 and
golang.org/x/netto v0.60.0, covering the standard-library and HTTP/2 security findings from the current vulnerability database. The linter is pinned to v2.14.0 to read Go 1.27.2 export data with the existing checks unchanged.How to test this PR?
make test: passed, including repository-wide lint (0 issues), generated files, rebrand checks, build and 51 test packages.-race: passed.make lintwith golangci-lint v2.14.0 reports 0 issues, andgovulncheckreports 0 reachable vulnerabilities.make checkpassed; site PR #38 is merged after its GitHub Actions and Cloudflare checks passed.Compatibility impact
Public destination
versionIdrequests now return403, including requests signed by root unless they establish replication trust. Locked null-version overwrites are rejected. Trusted replication retains source version IDs, batch Snowball supplies the required marker, normal in-flight multipart uploads survive enabling versioning, and unaddressed trusted replica callbacks preserve their existing availability behavior. No storage format changes. The build requires Go 1.27.2 and updatesgolang.org/x/netfrom v0.59.0 to v0.60.0 for the October security fixes; the Docker build stages use the verified Go 1.27.2 image digest. Rolling back restores the vulnerabilities; all S3-writing sites must be upgraded for the protection to hold across replication.Types of changes
Checklist
make verifiers, relevant tests andmake buildpassContribution Licensing
This contribution is made to PGSTY SILO under AGPL-3.0-or-later, with DCO sign-off as described in CONTRIBUTING.md. Existing copyright and license notices are preserved. No CLA or separate Apache-2.0 grant applies.
Developed with Codex (Astra); the commit retains
Co-authored-by: Codex <[email protected]>.