Skip to content

v1.8.3

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Dec 09:17
· 11 commits to main since this release
beaca0b

MirrorProxy v1.8.3

Security fixes

Bounded Prometheus HTTP method labels (GHSA-vh4g-fm5v-w9qf)

Prometheus HTTP request and duration metrics now normalize the method label to a bounded allowlist of standard HTTP methods, collapsing unknown methods to OTHER. This prevents unauthenticated clients from creating unbounded Prometheus time series with arbitrary HTTP method tokens (affecting versions >= 1.1.0, < 1.8.3). Thank you to @lml20000827 for reporting GHSA-vh4g-fm5v-w9qf.

Proxy browser isolation, Pub & OCI path hardening, and SSRF consistency

  • All proxied routes now return a sandboxed Content Security Policy (sandbox; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none') and strip upstream Set-Cookie and Clear-Site-Data response headers to protect same-origin administration and user sessions.
  • Pub storage downloads under /pub/upstream/storage.googleapis.com/ are restricted to official pub-packages/packages/*.tar.gz archives and served with Content-Type: application/octet-stream and Content-Disposition: attachment.
  • OCI path parsing now rejects traversal and invalid segments in the post-marker suffix (manifests, blobs, tags, referrers) as well as repository segments.
  • Proxy redirect and OCI bearer token destination validation now reuses the stricter download::public_ip blocklist (including Azure platform IP 168.63.129.16/32 and non-global IPv6 ranges) with a 5-second DNS timeout and 64-address cap.

Bounded metadata reads and authentication rate-limit hardening

  • Metadata rewriting in PyPI, npm, Composer, NuGet, and Pub now enforces both Content-Length and streamed byte limits (32 MiB per package response, 128 MiB for the PyPI root index), returning HTTP 502 if exceeded and streaming non-rewritten responses directly. OCI bearer token responses (1 MiB) and GeoIP updates (80 MiB) also use chunked bounded reads.
  • POST /api/admin/login and SMTP email login rate limiting now resolve client IPs via trusted_proxies rather than sharing a single "unknown" or reverse-proxy bucket.
  • Passkey login endpoints (/admin/api/auth/passkey/login/start and /finish) are rate-limited per client IP, and discoverable challenges are capped per source IP so one client cannot exhaust the global pool. AdminLoginRateLimiter now bounds total keys and username length.
  • OAuth account linking (/api/account/providers/{slug}/link/start) now uses CSRF-protected POST, verifies the active user session on callback, and checks user.disabled before auto-linking. Email login verification enforces same-origin checks, Cache-Control: no-store, and registration.mode == "disabled", while the web console immediately clears magic-link tokens from the address bar.
  • UpstreamAuth redacts credentials in Debug output, and alert webhook delivery uses a hardened HTTP client with no ambient proxy, no redirects, and explicit timeouts.

Installer, packaging, dependency, and CI hardening

  • scripts/install.sh and scripts/install.ps1 now fetch .sha256 checksum files directly from GitHub Releases even when --mirror / -Mirror is used for the archive download, with stricter SHA-256 format validation and TLS 1.2+ enforcement on Windows PowerShell 5.1.
  • Linux DEB and RPM server packages install /etc/mirrorproxy/config.toml with 0600 permissions (and register DEBIAN/conffiles), and APT repository signing passes GPG passphrases via a 0600 temporary file instead of command-line arguments.
  • Web dependency overrides update cross-spawn (7.1.2), react-router/react-router-dom (7.18.7), and glob (14.0.7), resolving all npm audit findings.
  • Release and Docker workflows pin third-party publish actions to commit SHAs, validate wingetcreate.exe Authenticode signatures and tag format via environment variables, and drop unnecessary workflow write permissions.

Compatibility and upgrade notes

  • Proxy responses & Pub: Only official pub-packages/packages/*.tar.gz archives are served under /pub/upstream/storage.googleapis.com/, and rewritten package metadata responses larger than 32 MiB (128 MiB for PyPI root index) return HTTP 502 Bad Gateway.
  • Mirrored client installation: When installing with --mirror or -Mirror, direct HTTPS reachability to GitHub is required to verify the official .sha256 checksum before unpacking or replacing the client.
  • Email verification: If registration.mode = "disabled", pending email invitations can no longer create new accounts.

Verification and rollback

Back up /etc/mirrorproxy/config.toml (or your active config.toml) and the SQLite database, verify the release artifact against SHA256SUMS, replace the binary, and restart the service. Confirm --version reports 1.8.3, verify /healthz and /version, and test a representative package proxy route (for example, fetching /pub/api/packages/http and confirming unrelated storage buckets return HTTP 400 with a sandboxed CSP). If rollback is required, restore the previous binary and pre-upgrade backup.

Full comparison from v1.8.2 to v1.8.3