Skip to content

fix: review batch 5 — data-loss race, cross-format writes, fail-open gates - #434

Merged
M0Rf30 merged 3 commits into
mainfrom
fix/review-batch-5
Nov 8, 2026
Merged

M0Rf30 merged 3 commits into
mainfrom
fix/review-batch-5

Conversation

@M0Rf30

@M0Rf30 M0Rf30 commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Fixes the findings of the fifth codebase review: a race that dropped
freshly uploaded files, format handlers acting on repositories of another
format, scan gates and quarantines that failed open, and a set of
correctness, security and documentation defects across the stack.

Data integrity

  • Lock packages then versions before pruning or trashing empty versions,
    so a concurrent upload's committed file is never cascaded away.
  • Hosted format handlers refuse repositories of another format centrally
    in base.Handler (maven, raw, ivy/sbt, helm, pypi, nuget, ...); pypi and
    helm queries are format-scoped and raw upserts keep foreign files.
  • Docker blob DELETE removes only the image's link; the blob goes with
    the last image and a referenced blob answers 409.
  • Docker cleanup policies and registry GC honour release-bundle pins.
  • A signing failure fails deb/rpm metadata generation instead of
    publishing unsigned indexes; InRelease is signed with the signing subkey.
  • Bundle archive is a conditional update that no longer clobbers a
    concurrent promotion.

Security

  • The vuln gate fails unless the scan completed and requested feeds are
    loaded; responses carry scan_status and failed_scanners.
  • Re-scans keep an existing secret/vuln quarantine.
  • CSRF rejects cross-site Basic credentials outside /api/v1; conan v1
    delete bodies must be JSON.
  • Seeded admin-all/anonymous-read targets are immutable; unassigning and
    disabling share one locked last-admin check.
  • oa shell completion no longer sends the saved token to another server.

Reliability and quotas

  • Webhook response bodies are stored as valid UTF-8, ending endless
    redeliveries; RecoveryMiddleware re-panics http.ErrAbortHandler.
  • Staged nix NARs reserve quota (migration 019); raw PUT prechecks quota;
    overwrites release the size of the row actually replaced.
  • Azure Put uploads blocks above 5000 MiB; failed docker commits discard
    the session; federation peer updates keep undecryptable secrets.
  • Backups skip service-account grants; restore no longer mistakes any
    unique violation for the bootstrap admin.

API, CLI and CI

  • Cleanup policy PUT clears keep rules with null; duplicate SSO slugs 409.
  • OSV fixed_in is package- and branch-aware; EPSS rejects NaN.
  • Unknown server subcommands error; ./-prefixed upload globs match.
  • Release workflow no longer moves :latest on re-releases.
  • OpenAPI, backup, HSTS, TLS-key, apk-snippet and pprof docs corrected.

Web

  • Forced password change redirects mid-session; isAdmin trusts only
    is_admin; partial quarantine/SBOM failures reported; declarative,
    attention, quota, AI-poll and exploit-feed edge states fixed; counts are
    locale-formatted.

…gates

Fixes the findings of the fifth codebase review: a race that dropped
freshly uploaded files, format handlers acting on repositories of another
format, scan gates and quarantines that failed open, and a set of
correctness, security and documentation defects across the stack.

Data integrity
- Lock packages then versions before pruning or trashing empty versions,
  so a concurrent upload's committed file is never cascaded away.
- Hosted format handlers refuse repositories of another format centrally
  in base.Handler (maven, raw, ivy/sbt, helm, pypi, nuget, ...); pypi and
  helm queries are format-scoped and raw upserts keep foreign files.
- Docker blob DELETE removes only the image's link; the blob goes with
  the last image and a referenced blob answers 409.
- Docker cleanup policies and registry GC honour release-bundle pins.
- A signing failure fails deb/rpm metadata generation instead of
  publishing unsigned indexes; InRelease is signed with the signing subkey.
- Bundle archive is a conditional update that no longer clobbers a
  concurrent promotion.

Security
- The vuln gate fails unless the scan completed and requested feeds are
  loaded; responses carry scan_status and failed_scanners.
- Re-scans keep an existing secret/vuln quarantine.
- CSRF rejects cross-site Basic credentials outside /api/v1; conan v1
  delete bodies must be JSON.
- Seeded admin-all/anonymous-read targets are immutable; unassigning and
  disabling share one locked last-admin check.
- oa shell completion no longer sends the saved token to another server.

Reliability and quotas
- Webhook response bodies are stored as valid UTF-8, ending endless
  redeliveries; RecoveryMiddleware re-panics http.ErrAbortHandler.
- Staged nix NARs reserve quota (migration 019); raw PUT prechecks quota;
  overwrites release the size of the row actually replaced.
- Azure Put uploads blocks above 5000 MiB; failed docker commits discard
  the session; federation peer updates keep undecryptable secrets.
- Backups skip service-account grants; restore no longer mistakes any
  unique violation for the bootstrap admin.

API, CLI and CI
- Cleanup policy PUT clears keep rules with null; duplicate SSO slugs 409.
- OSV fixed_in is package- and branch-aware; EPSS rejects NaN.
- Unknown server subcommands error; ./-prefixed upload globs match.
- Release workflow no longer moves :latest on re-releases.
- OpenAPI, backup, HSTS, TLS-key, apk-snippet and pprof docs corrected.

Web
- Forced password change redirects mid-session; isAdmin trusts only
  is_admin; partial quarantine/SBOM failures reported; declarative,
  attention, quota, AI-poll and exploit-feed edge states fixed; counts are
  locale-formatted.
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Coverage

Coverage vs main
Go, unit + integration 83.5% +0.1
Go, unit tests only 69.9% ±0.0
Go, integration tests only 54.7% +0.1
Web, lines 91.1% ±0.0
Web, functions 84.8% ±0.0
Go by area
Area Coverage vs main
cmd/docgen 80.3% ±0.0
cmd/genformats 90.8% ±0.0
cmd/oa 0.0% ±0.0
cmd/resetpw 0.0% ±0.0
cmd/server 70.8% +0.1
internal/ai 85.6% ±0.0
internal/api 76.8% +0.1
internal/apkkeys 77.1% ±0.0
internal/artifactpath 100.0% ±0.0
internal/attest 85.6% ±0.0
internal/audit 97.6% ±0.0
internal/auth 91.3% ±0.0
internal/backup 72.4% +0.3
internal/bgtask 96.8% ±0.0
internal/branding 93.5% ±0.0
internal/clientsetup 93.6% ±0.0
internal/config 96.4% ±0.0
internal/cron 90.0% ±0.0
internal/crypto 91.0% ±0.0
internal/curation 99.0% ±0.0
internal/database 78.3% +0.2
internal/declarative 83.5% ±0.0
internal/dtrack 85.3% ±0.0
internal/exploit 93.6% ±0.0
internal/federation 81.2% ±0.0
internal/format 81.1% +0.2
internal/formats 87.9% ±0.0
internal/gpgkeys 86.8% ±0.0
internal/group 89.5% ±0.0
internal/httpcache 100.0% ±0.0
internal/httpcompress 93.3% ±0.0
internal/httpx 85.7% ±0.0
internal/importmeta 93.3% ±0.0
internal/iocopy 100.0% ±0.0
internal/itempath 98.3% ±0.0
internal/lazyre 100.0% ±0.0
internal/license 98.5% ±0.0
internal/licensemeta 87.5% ±0.0
internal/licensepolicy 92.6% ±0.0
internal/limitio 92.9% ±0.0
internal/mcp 89.5% ±0.0
internal/metrics 96.2% ±0.0
internal/middleware 94.1% +0.1
internal/netutil 93.1% ±0.0
internal/nixkeys 79.6% ±0.0
internal/oacli 84.8% ±0.0
internal/ocimanifest 100.0% ±0.0
internal/ocipath 100.0% ±0.0
internal/osv 89.8% +1.3
internal/passwd 93.3% ±0.0
internal/pathseg 100.0% ±0.0
internal/pglock 79.0% -10.5
internal/pkgdeps 88.1% ±0.0
internal/presign 99.2% ±0.0
internal/promote 85.1% ±0.0
internal/proxy 86.5% ±0.0
internal/publicurl 96.8% ±0.0
internal/pypisimple 97.9% ±0.0
internal/quarantine 100.0% ±0.0
internal/quota 90.7% +2.3
internal/recovery 85.8% +0.2
internal/registry 100.0% ±0.0
internal/replication 78.2% ±0.0
internal/repodispatch 84.8% ±0.0
internal/repotype 97.0% ±0.0
internal/sbom 90.6% ±0.0
internal/scanexport 96.4% ±0.0
internal/search 90.7% ±0.0
internal/secrets 91.4% ±0.0
internal/storage 84.8% ±0.0
internal/telemetry 92.2% ±0.0
internal/tiering 83.5% ±0.0
internal/trash 96.7% ±0.0
internal/urlparams 100.0% ±0.0
internal/vuln 89.9% +0.4
internal/webhook 84.1% ±0.0
internal/worker 82.5% -0.1
internal/workq 79.5% ±0.0
pkg/ansible 89.8% ±0.0
pkg/apk 96.0% ±0.0
pkg/cargo 95.6% ±0.0
pkg/compactindex 97.8% ±0.0
pkg/composer 94.5% ±0.0
pkg/conan 99.2% ±0.0
pkg/conda 94.8% ±0.0
pkg/deb 80.2% ±0.0
pkg/delta 71.4% ±0.0
pkg/gemversion 100.0% ±0.0
pkg/gpg 86.5% -0.2
pkg/helm 97.0% ±0.0
pkg/logger 93.8% ±0.0
pkg/maven 96.7% ±0.0
pkg/nix 99.1% ±0.0
pkg/npm 88.0% ±0.0
pkg/nuget 97.6% ±0.0
pkg/pacman 90.4% ±0.0
pkg/pyversion 100.0% ±0.0
pkg/rpm 92.3% ±0.0
pkg/rpmsign 90.5% ±0.0
pkg/rubymarshal 87.1% ±0.0
pkg/xzlimit 63.3% ±0.0
tests/integration 78.8% ±0.0
web 93.7% ±0.0
Web by area (lines)
Area Coverage vs main
src 24.2% ±0.0
src/api 91.6% +0.1
src/components 89.2% -0.1
src/composables 92.3% ±0.0
src/i18n 98.5% ±0.0
src/lib 99.2% ±0.0
src/pages 91.9% ±0.0
src/pwa 97.6% ±0.0
src/router 99.7% ±0.0
src/stores 99.0% ±0.0
src/telemetry 90.9% ±0.0

Full report (HTML, merged profile) in the CI run artifacts

@M0Rf30
M0Rf30 merged commit 638694a into main Nov 8, 2026
25 checks passed
@M0Rf30
M0Rf30 deleted the fix/review-batch-5 branch November 8, 2026 14:04
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