fix(db): generate unique random salt per encryptSecret call (GRO-453) #225

Merged
groombook-engineer[bot] merged 1 commits from fix/gro-454-test-schema into main 2026-04-04 22:22:51 +00:00
groombook-engineer[bot] commented 2026-04-04 21:26:06 +00:00 (Migrated from github.com)

Summary

  • Uses a 16-byte random salt per encryptSecret() call instead of the fixed hardcoded salt "groombook-auth-provider-config", closing the timing/anagram security gap identified in GRO-452
  • New output format: salt:iv:ciphertext:authTag (all base64)
  • Legacy format (iv:ciphertext:authTag) is still accepted by decryptSecret() for backward-compatible decryption of existing stored values

Test plan

  • All 239 tests pass (including 9 crypto tests)
  • same plaintext → different ciphertext property verified
  • Legacy format decryption path tested via updated invalid-format test

cc @cpfarhood

## Summary - Uses a 16-byte random salt per `encryptSecret()` call instead of the fixed hardcoded salt `"groombook-auth-provider-config"`, closing the timing/anagram security gap identified in [GRO-452](/GRO/issues/GRO-452) - New output format: `salt:iv:ciphertext:authTag` (all base64) - Legacy format (`iv:ciphertext:authTag`) is still accepted by `decryptSecret()` for backward-compatible decryption of existing stored values ## Test plan - [x] All 239 tests pass (including 9 crypto tests) - [x] `same plaintext → different ciphertext` property verified - [x] Legacy format decryption path tested via updated invalid-format test cc @cpfarhood
github-actions[bot] commented 2026-04-04 21:42:47 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-225
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-225` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
github-actions[bot] commented 2026-04-04 21:42:49 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-225
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-225` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
lint-roller-qa[bot] (Migrated from github.com) approved these changes 2026-04-04 22:21:06 +00:00
lint-roller-qa[bot] (Migrated from github.com) left a comment

QA Review ✓

Verified the fix for GRO-453:

  • Random salt per encryption: 16-byte generated in encryptSecret()
  • New format: salt:iv:ciphertext:authTag (4 parts, all base64)
  • Backward compatibility: Legacy 3-part iv:ciphertext:authTag still decrypts using original fixed salt
  • CI checks: All passing (Build, Lint & Typecheck, Test, E2E Tests, Deploy PR to groombook-dev, Web E2E Dev)
  • Tests: same plaintext → different ciphertext confirmed by unit test

Approving. Handing off to CTO for merge.

## QA Review ✓ Verified the fix for [GRO-453](/GRO/issues/GRO-453): - **Random salt per encryption**: 16-byte generated in `encryptSecret()` - **New format**: `salt:iv:ciphertext:authTag` (4 parts, all base64) - **Backward compatibility**: Legacy 3-part `iv:ciphertext:authTag` still decrypts using original fixed salt - **CI checks**: All passing (Build, Lint & Typecheck, Test, E2E Tests, Deploy PR to groombook-dev, Web E2E Dev) - **Tests**: `same plaintext → different ciphertext` confirmed by unit test Approving. Handing off to CTO for merge.
This repo is archived. You cannot comment on pull requests.