Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Hardcoded Authentication Secrets and 2FA Bypasses#100

Open
secrooq wants to merge 1 commit into
mainfrom
sentinel-remove-hardcoded-secrets-12492422081940115033
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Fix Hardcoded Authentication Secrets and 2FA Bypasses#100
secrooq wants to merge 1 commit into
mainfrom
sentinel-remove-hardcoded-secrets-12492422081940115033

Conversation

@secrooq

@secrooq secrooq commented Jun 29, 2026

Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: The application relied on hardcoded fallbacks for AUTH_SECRET in NextAuth and src/middleware.ts, and utilized a static backdoor string (stealth_dev_bypass_root_2026) for bypassing 2FA during admin recovery.
🎯 Impact: If these files were leaked, an attacker could easily spoof valid administrative sessions using the known NextAuth encryption keys, or completely bypass the Two-Factor Authentication requirement for administrative users using the static backdoor string.
πŸ”§ Fix: Removed the static string fallbacks from g.process.env edge initialization in both src/auth.ts and src/middleware.ts. Replaced the static string fallback for NextAuth secret initialization with strict environment variable retrieval. Replaced the static 2FA backdoor expected secret with strict environment variable enforcement (process.env.ADMIN_BYPASS_SECRET).
βœ… Verification: Ran unit tests (pnpm test) and production end-to-end tests (npx playwright test), both of which passed with the updated strict environment variables injected via test runtime configurations. Added the findings to .jules/sentinel.md journal.


PR created automatically by Jules for task 12492422081940115033 started by @secrooq

Removed hardcoded `AUTH_SECRET` fallbacks from `src/middleware.ts` and `src/auth.ts`, alongside a hardcoded 2FA admin bypass backdoor. This enforces strict environment variable configuration, ensuring authentication mechanisms fail securely rather than defaulting to known, easily exploitable secrets.

Co-authored-by: secrooq <81346684+secrooq@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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