Skip to content

fix: enforce retention authorization and immutable version writes - #234

Merged
Vonng merged 3 commits into
mainfrom
codex/fix-retention-write-bypasses
Oct 14, 2026
Merged

Vonng merged 3 commits into
mainfrom
codex/fix-retention-write-bypasses

Conversation

@Vonng

@Vonng Vonng commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

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/net to 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.
  • Focused retention, version-addressing, null-overwrite, cross-pool and replica-availability tests with -race: passed.
  • Original independent regression probes: all 14 passed.
  • Go 1.27.2: focused race regressions passed, make lint with golangci-lint v2.14.0 reports 0 issues, and govulncheck reports 0 reachable vulnerabilities.
  • Bilingual companion documentation: make check passed; site PR #38 is merged after its GitHub Actions and Cloudflare checks passed.

Compatibility impact

Public destination versionId requests now return 403, 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 updates golang.org/x/net from 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

  • Bug fix
  • Intentional tightening of unsafe version-addressed write behavior

Checklist

  • Commits carry the author's DCO sign-off
  • Unit tests added and updated
  • make verifiers, relevant tests and make build pass
  • Compatibility and rollback impact documented
  • English and Chinese companion documentation in pgsty/silo.pgsty.com#38

Contribution 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]>.

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)
Vonng and others added 2 commits October 14, 2026 15:39
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]>
@Vonng
Vonng merged commit 14042b5 into main Oct 14, 2026
11 checks passed
@Vonng Vonng added this to the 20261018 milestone Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant