fix(account-merge): notify master account when a merge is confirmed via e-mail code#3872
Draft
TaprootFreak wants to merge 1 commit into
Draft
fix(account-merge): notify master account when a merge is confirmed via e-mail code#3872TaprootFreak wants to merge 1 commit into
TaprootFreak wants to merge 1 commit into
Conversation
…ia e-mail code executeMerge called mergeUserData without notifyUser, so the master account (the one being merged into) was never told. For IDENT_DOCUMENT merges the confirmation code is mailed to the slave, not the master — i.e. the one merge path an outside party can drive is also the only one that left the affected account unaware. The AML and admin merge callers already pass notifyUser=true; align the e-mail-confirmation path with them so the master receives the added-address / changed-mail notification and can react if the merge was not legitimate. No change to the token/auth logic — the re-registration flow is untouched. Added an executeMerge test asserting notifyUser=true.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hintergrund
Aus dem branch-weiten Security-Review (High-Finding Account-Merge):
GET /auth/mail/confirmgibt nach einem Mergemaster.kycHash+ ein Account-Token an den Code-Inhaber heraus. Im IDENT_DOCUMENT-Flow (sendToSlave=true) wird der Bestätigungscode an den slave gemailt, nicht an den master — d.h. ausgerechnet der einzige Merge-Pfad, den ein Externer auslösen kann, lief bisher ohne jede Benachrichtigung des betroffenen Master-Kontos ab.Verifiziert: Der Merge-Trigger
identDocumentIdstammt ausschliesslich aus verifizierten Ident-Provider-Daten (Sumsub/IdNow/manuell), nicht aus user-eingegebenen Formulardaten (kyc-step.entity.ts) — der Angriff ist also stark gated (echte biometrische Dokument-Kollision nötig). Die Token-Ausgabe selbst ist zugleich der legitime Re-Registrierungs-Pfad; sie hart zu beschneiden würde echte Kunden treffen. Deshalb hier die nebenwirkungsfreie Härtung statt eines Auth-Eingriffs.Fix
Der Benachrichtigungs-Mechanismus existiert bereits (
userDataAddedAddressInfo/userDataChangedMailInfoanmaster.mail), war aber für den Bestätigungs-Flow abgeschaltet:executeMergeriefmergeUserData(...)ohnenotifyUserauf (Defaultfalse). Die anderen beiden Aufrufer setzentrue:aml.service.ts:162(automatischer AML-Merge) →trueuser-data.controller.ts:107(Admin/Support-Merge) →trueaccount-merge.service.ts(Mail-Bestätigung) → fehlteDiese PR setzt
notifyUser=trueauch im Bestätigungs-Pfad. Das Master-Konto erhält damit die bereits vorhandene, übersetzte Added-Address-/Changed-Mail-Benachrichtigung und kann reagieren, falls der Merge nicht legitim war.Keine Änderung an der Token-/Auth-Logik — der Re-Registrierungs-Flow bleibt unangetastet.
Tests
Neuer
executeMerge-Test prüft, dassmergeUserDatamitnotifyUser=trueaufgerufen wird.format:check,type-check,lintsauber; account-merge-Suite 13/13 grün.Nicht in dieser PR
Die theoretische Token-/kycHash-Bindung (Fallback
generateAccountTokenan Nicht-Master-Adressen) bleibt offen — das ist ein Auth-/UX-Designentscheid mit Kundenimpact und gehört in Abstimmung mit dem Auth-Flow-Owner separat behandelt.