Found by @AAlhazwani-WMF:
- Ada creates an account, and provides Bob’s email during registration
- Bob receives the “Welcome” email
- Bob ignores the email
- Bob receives the “Welcome” email
- Ada changes their (Bob’s) email in Special:Preferences
- Bob receives the “Wikipedia registered email address has been changed” email to their email address. This email includes Ada's IP address, username, and personal email [1]
- Ada receives the “Welcome” email to the their email address
- A should not happen. It discloses Ada's IP to Bob, and is probably needlessly scary for Bob the way it is phrased.
This bug was introduced 9 years ago (1.27.0) in User.php: Update 'setEmailWithConfirmation' for notification email for T31856: Email notification to old address when verified email address is changed or removed. Notice how the task talks about verified emil addresses, but the change does not introduce a check for that.