Skip to content

feat: srp removal#4270

Merged
varonix0 merged 12 commits into
mainfrom
daniel/srp-removal-round-2
Aug 5, 2025
Merged

feat: srp removal#4270
varonix0 merged 12 commits into
mainfrom
daniel/srp-removal-round-2

Conversation

@varonix0
Copy link
Copy Markdown
Member

@varonix0 varonix0 commented Jul 30, 2025

Description 📣

This long awaited PR fully removes SRP usage! We are keeping the SRP functionality for logging in, so older users can keep using Infisical.

CLI PR: Infisical/cli#6

  1. SRP auth is fully removed, but if the new login fails it will fall back to SRP on both the UI and CLI.
  2. Key sharing for projects is removed and ghost users are no more (for new projects)
    a. Things will keep working for existing legacy projects because we keep the project keys, we aren't removing any data.
  3. The private key no longer exists on the frontend!
  4. All the encryption key fields in the user encryption key table are now nullable, as they aren't needed anymore.

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

@maidul98
Copy link
Copy Markdown
Collaborator

maidul98 commented Jul 30, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR implements a major architectural shift to remove SRP (Secure Remote Password) authentication from Infisical while maintaining backward compatibility. The changes introduce a new simplified authentication flow (LoginV3) that uses direct email/password verification instead of the complex SRP protocol, while keeping SRP as a fallback for existing users.

Key changes include:

Authentication Modernization: The frontend and CLI now use a new LoginV3 endpoint that performs server-side password verification, eliminating the need for complex client-side cryptographic operations. When this fails with a 'LegacyEncryptionScheme' error, the system gracefully falls back to SRP authentication.

Database Schema Changes: User encryption key fields (publicKey, encryptedPrivateKey, iv, tag, salt, verifier) are now nullable through migration 20250723220500_remove-srp.ts, allowing new users to exist without SRP-specific encryption keys while preserving legacy users' data.

Frontend Simplification: The signup and password management flows have been dramatically simplified, removing complex cryptographic operations including key pair generation, Argon2 key derivation, and AES-256-GCM encryption. Private keys are no longer stored in localStorage or managed on the frontend.

Project Key Sharing Removal: New projects (V3+) no longer use the legacy ghost user and project key sharing mechanism. The system now skips complex key distribution for newer projects while maintaining backward compatibility for V1/V2 legacy projects.

API Schema Updates: Response schemas across multiple endpoints have been updated to make publicKey and other encryption-related fields nullable/optional, reflecting the new architecture where these fields may not exist for new users.

Service Layer Refactoring: Dependencies on projectBotDAL, projectKeyDAL, and complex encryption services have been removed from various service factories, while defensive null checks have been added throughout the codebase to handle the new nullable encryption fields.

The changes maintain full backward compatibility by preserving all existing data and keeping SRP login functionality intact, ensuring no users are locked out during this transition.

Confidence score: 2/5

• This PR introduces significant breaking changes and type inconsistencies that could cause runtime failures
• Multiple files have type mismatches where nullable fields are still expected to be non-null in the implementation
• The removal of critical utility functions like saveTokenToLocalStorage and fetchMyPrivateKey without updating all dependent code creates potential runtime errors

68 files reviewed, 16 comments

Edit Code Review Bot Settings | Greptile

Comment thread backend/src/server/routes/v3/login-router.ts
Comment thread backend/src/services/org-admin/org-admin-service.ts Outdated
Comment thread backend/src/server/routes/v3/login-router.ts Outdated
Comment thread frontend/src/components/utilities/attemptCliLogin.ts Outdated
Comment thread backend/src/services/auth/auth-login-service.ts
Comment thread backend/src/db/migrations/20250723220500_remove-srp.ts Outdated
Comment thread backend/src/db/migrations/20250723220500_remove-srp.ts
Comment thread frontend/src/components/utilities/attemptLogin.ts
Comment thread frontend/src/components/utilities/attemptLogin.ts Outdated
@varonix0 varonix0 mentioned this pull request Jul 30, 2025
6 tasks
@Infisical Infisical deleted a comment from greptile-apps Bot Jul 30, 2025
akhilmhdh
akhilmhdh previously approved these changes Jul 30, 2025
Comment thread frontend/src/components/auth/UserInfoStep.tsx Outdated
Comment thread backend/src/services/auth/auth-login-service.ts
Comment thread backend/src/services/org-admin/org-admin-service.ts
@varonix0 varonix0 self-assigned this Aug 5, 2025
@varonix0 varonix0 merged commit b51d997 into main Aug 5, 2025
10 of 11 checks passed
@varonix0 varonix0 deleted the daniel/srp-removal-round-2 branch November 19, 2025 01:02
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.

4 participants