Repository navigation
fix: post-deploy findings — reset flow, uploads, redirects, deploy env - #123
Merged
Merged
Conversation
Middleware blocked /forgot-password and /reset-password for logged-out users. Analytics now renders only on public pages, the form strips the token from the URL, and resetPassword is rate-limited.
Browsers read "/\host" as "//host", which the prefix check allowed. Resolve against the origin and compare origins instead.
The runtime user couldn't write the root-owned uploads volume. Uploads now block READONLY and are rate-limited; non-ASCII names (every macOS screenshot) no longer crash the download header.
The OG route read Next 16's Promise params synchronously and 500'd.
No page uses /_next/image (the GHSA-2xp9 component), and nginx reaches the app on 127.0.0.1. Also stops sending X-Powered-By.
Fresh installs kept the public .env.example AUTH_SECRET. AUTH_URL now follows NEXT_PUBLIC_APP_URL, so sign-out stops landing on the container hostname.
Cron jobs have never run; ROADMAP claimed they worked.
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.
Why
After #118 went live, a 26-agent outside-in sweep of akritos.com confirmed the Next.js RCE fix and turned up older bugs. An adversarial review of the fixes (49 agents) then caught one leak the first draft introduced, and two latent security bugs next to the code being changed. Everything below is fixed and verified against the real production image.
Security
/reset-passwordto logged-out users would have put its one-hour token on a page running GA4, which reports the full URL. Analytics now renders only on public pages: never on/dashboard,/portal,/login,/forgot-password,/reset-passwordor/support/track. That also stops the pre-existing portal and ticket-tracking token leak. The reset form strips the token from the URL on load.//hostbut not/\host, which browsers normalize to//host.lib/safe-redirect.tsnow resolves against the origin and compares origins, with 15 test cases.AUTH_SECRETplaceholder.deploy.shnow treats.env.exampleplaceholders as missing, so anyone could previously have forged a session on a rebuilt box. The live site is not affected: the CSRF-cookie hash matches none of the placeholder values.APP_ENCRYPTION_KEYno longer re-rotates on every deploy.images.unoptimized). No page uses it, it's the GHSA-2xp9 component, and its cache was unwritable, so every request re-processed.127.0.0.1(nginx already proxies there);X-Powered-Byremoved;resetPasswordrate-limited;PUBLIC_PATHSmatches whole segments, so a future/bookkeepingcan't become public via/book.Broken features fixed
proxy.tssent logged-out users to/login.node) couldn't write the root-owned volume. Uploads now block READONLY (403) and are rate-limited (30/hour). Downloads of non-ASCII names (every macOS screenshot has U+202F) now use RFC 6266 instead of crashing into a masked 404.paramsis a Promise.https://<container-id>:3000:AUTH_URLis now synced fromNEXT_PUBLIC_APP_URLevery deploy./blogstops canonicalizing to the homepage;/pricingtitle no longer says "Akritos" twice.Verified
/_next/imagereturns 404AUTH_URLis honored, and a control container without it reproduces the container-hostname bugnode:node, and code files stay root-owned/but not on private pages/reset-password,/portal/*and/loginload no Google scripts and make no Google requestscallbackUrl=/\evil.examplelands on/dashboardresetPassword: 10, then 429deploy.shenv logic: 14.env.localvariants on Ubuntu 24.04 underset -e, all idempotent. A live-like file changes only by gainingAUTH_URL.npm auditgate, Semgrep 0 findings.Deploy notes
nodeownership automatically.deploy.shaddsAUTH_URL=<your NEXT_PUBLIC_APP_URL origin>. IfNEXT_PUBLIC_APP_URLis unset or local, it only warns and nothing breaks.Documented, not fixed: cron jobs have never run; booking slots are wrong for visitors east of New York; uploads aren't backed up (see CLAUDE.md Known Issues).
🤖 Generated with Claude Code