Skip to content

Fix Security Vulnerability by Validating AUTH_SECRET and ENCRYPTION_KEY - #8989

Open
Rakshak05 wants to merge 2 commits into
JhaSourav07:mainfrom
Rakshak05:issue-#7718
Open

Fix Security Vulnerability by Validating AUTH_SECRET and ENCRYPTION_KEY#8989
Rakshak05 wants to merge 2 commits into
JhaSourav07:mainfrom
Rakshak05:issue-#7718

Conversation

@Rakshak05

Copy link
Copy Markdown
Contributor

Description

Fixes #7718

Enforces strict environment variable validation for AUTH_SECRET (and ENCRYPTION_KEY) in lib/validate-env.ts. Server startup (instrumentation.ts) will now fail loudly with an explicit error message if default or fallback secret strings (such as 'fallback-secret') are set in the environment, preventing cryptographic key exposure and session hijacking risks.

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

N/A (Server startup security environment validation)

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

Copilot AI lite review requested due to automatic review settings August 10, 2026 14:00
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@Rakshak05 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@retenta-bot

retenta-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

This PR addresses a critical security issue by ensuring that fallback keys are not used, which could lead to cryptographic vulnerabilities. It's similar to previous decisions made to enhance user experience and security, such as fixing theme rendering based on system preferences. Thank you for your contribution, and I look forward to your updates!

@retenta-bot retenta-bot Bot changed the title fix(security): strictly validate AUTH_SECRET to prevent fallback key exposure-#7718 Fix Security Vulnerability by Validating AUTH_SECRET and ENCRYPTION_KEY Aug 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 4998.89 KB 4998.89 KB 0 B
Total CSS 354.18 KB 354.18 KB 0 B

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.

[Security] Hardcoded fallback AUTH_SECRET exposes cryptographic signing key

2 participants