Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Add authentication to user admin routes and fix sync crypto DoS - #102

Open
aperetti wants to merge 1 commit into
mainfrom
sentinel-admin-auth-dos-fix-17808494147750802462
Open

πŸ›‘οΈ Sentinel: [CRITICAL] Add authentication to user admin routes and fix sync crypto DoS#102
aperetti wants to merge 1 commit into
mainfrom
sentinel-admin-auth-dos-fix-17808494147750802462

Conversation

@aperetti

Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: The usersRoutes in the admin console backend (admin-console/admin-backend/src/features/users/routes.ts) lacked any authentication, exposing sensitive administrative actions (listing, creating, deleting users) to public access. Furthermore, password verification was vulnerable to timing-based discovery and lacked proper length checks before crypto.timingSafeEqual, which throws TypeError on mismatched buffer sizes.
🎯 Impact: Unauthorized individuals could trivially compromise the system by viewing the list of existing administrative users and forging their own admin credentials or deleting existing ones. Exploiting the timingSafeEqual length mismatch would cause an unhandled exception, repeatedly crashing the admin backend (Denial of Service).
πŸ”§ Fix: Added a Fastify onRequest hook applying HTTP Basic Authentication to the usersRoutes scope. The authentication properly checks the Authorization header, retrieves the user from the database, asynchronously derives the key using pbkdf2Async, and compares it securely with crypto.timingSafeEqual ensuring lengths match first. Corrected the base64 parsing logic to properly handle passwords that may legitimately contain colon (:) characters.
βœ… Verification: Verified by running npx tsc --noEmit and vitest in the admin-console/admin-backend directory resulting in 0 errors and 0 test failures.


PR created automatically by Jules for task 17808494147750802462 started by @aperetti

…ix sync crypto DoS

Co-authored-by: aperetti <482392+aperetti@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