Skip to content

fix: secure database rules, harden feature request form, and patch Next.js - #75

Merged
onlyonehas merged 3 commits into
mainfrom
fix/feature-request-rules-and-errors
Nov 22, 2026
Merged

onlyonehas merged 3 commits into
mainfrom
fix/feature-request-rules-and-errors

Conversation

@onlyonehas

@onlyonehas onlyonehas commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • 🔒 Added database.rules.json and wired it into firebase.json.
    • Root read/write is now denied.
    • featureRequests accepts create-only public submissions with field validation (no reads, no overwrites, no deletes).
    • users/{uid} is readable/writable only by that signed-in user.
  • 🐛 Feature request form now shows a real error if saving fails, with a loading state and disabled button while submitting.
  • 🧹 Client code imports Firebase from lib/firebase-client instead of pages/_document (removes server-only code from the browser bundle).
  • 🛠️ Added npm run deploy:rules.
  • ⬆️ Upgraded Next.js 14.2.35 → 15.5.28 to clear the critical RCE advisories that made npm run audit fail.
    • Removed @types/next-pwa, which pulled in a second vulnerable [email protected].
    • Removed the now-unsupported swcMinify option.

Verification

  • ✅ Rules deployed to instant-calc and verified live:
    • unauthenticated read → denied
    • valid create → allowed
    • invalid payload → denied
    • overwrite existing request → denied
  • ✅ Tested the form end-to-end on the live site and local dev (Next 15); submissions save under Realtime Database → featureRequests.
  • ✅ npm run audit → exit 0 (no critical vulnerabilities).
  • ✅ npm run lint, npm test (41 tests), and npm run build pass.

Remaining audit findings

13 moderate + 25 high remain, mostly transitive through firebase@10 and the unmaintained next-pwa@5. They are below the project's critical threshold. Upgrading Firebase and replacing next-pwa can be separate follow-ups.

Notes

  • View submitted requests in Firebase Console → Realtime Database → Data → featureRequests.
  • The old insecure rules warning should clear after Firebase refreshes its check.

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 84998a1):

https://instant-calc--pr75-fix-feature-request-mvqf2ahp.web.app

(expires Sun, 29 Nov 2026 09:28:11 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6bc8ccb070bbb04b63e3a5957eef152c83a6b443

@onlyonehas onlyonehas changed the title fix: secure Realtime Database rules and harden feature request form fix: secure database rules, harden feature request form, and patch Next.js Nov 22, 2026
@onlyonehas
onlyonehas merged commit 56c8986 into main Nov 22, 2026
3 checks passed
@onlyonehas
onlyonehas deleted the fix/feature-request-rules-and-errors branch November 22, 2026 09:30

This branch was successfully deployed

1 active deployment
firebase — 84998a15 Deployed Nov 22, 2026 by onlyonehas via build_and_preview #78
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