The problem is when the backend function doesn't verify that the email matches the username.
The problem is when the backend function doesn't verify that the email matches the username.
Or perhaps said different: use the submitted info to identify the account; send any sensitive messages (recovery codes, password resets whatever) to only the contact info on file. If the chat bot can send such email it should do so via an API that sends only to contact info on file for the associated account and not to an email that's provided by the bot.
In principle, it could be designed to do so to handle cases where a new email address has been confirmed out of band, e.g. for an account representing a company or a political office. But that's a relatively unusual situation, not something you'd want to be available to every user writing in. (Even if you had an all-human support department, this sort of functionality would only be available to a select few agents.)
(Pick one:
"send text to number ending in -1234"
"send text to number ending in -5678"
"send email to jo......th@gmail.com" )
Unless the backend was _also_ vibe-coded, in which case it is still an AI problem.