Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$500] Chat - App allows to open any invalid email profile details using mention URL #28191

Closed
4 of 6 tasks
izarutskaya opened this issue Sep 25, 2023 · 13 comments
Closed
4 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@izarutskaya
Copy link

izarutskaya commented Sep 25, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open the app
  2. Open any report
  3. Write any user mention and send
  4. Click on mention and copy the URL
  5. Paste URL in compose box and remove or replace parts after 'login=' to make the email invalid eg: https://staging.new.expensify.com/details?login=abcd
  6. Send the URL and click on it
  7. Observe that instead of displaying 'Hmm its not here', app creates profile for invalid contact user

Expected Result:

App should display 'Hmm its not here' page when we try to open invalid contact profile details using mention URL

Actual Result:

App allows to open any invalid contact profile details on using mention URL structure

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.74-0

Reproducible in staging?: Y

Reproducible in production?: Y

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

app.allows.invalid.contact.profile.using.mention.URL.windows.chrome.mp4
Recording.1636.mp4
allows.invalid.email.contact.profile.details.IOS.1.mov
allows.invalid.email.contact.profile.details.IOS.mov
app.allows.invalid.contact.profile.using.mention.URL.android.chrome.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695485451642119

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016acedce6ab891123
  • Upwork Job ID: 1706398446874087424
  • Last Price Increase: 2023-09-25
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot changed the title Chat - App allows to open any invalid email profile details using mention URL [$500] Chat - App allows to open any invalid email profile details using mention URL Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Job added to Upwork: https://www.upwork.com/jobs/~016acedce6ab891123

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Triggered auto assignment to @JmillsExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External)

@izarutskaya
Copy link
Author

Proposal from @dhanashree-sawant

Please re-state the problem that we are trying to solve in this issue.

We are solving the problem of app allowing to open profile details of invalid contact using mention result

What is the root cause of that problem?

On DetailsPage we don't have any check to determine whether provided contact is valid or not

What changes do you think we should make in order to solve the problem?

Add new boolean which will check whether contact is valid contact or not and pass it in shouldShow parameter of FullPageNoFoundView to display 'Hmm its not here' page for invalid contact on DetailsPage
We can do that by adding new boolean here

const isValidContact = Str.isSMSLogin(details.login) || Str.isValidEmail(details.login) ? true : false;

Assign that boolean to FullPageNoFoundView shouldShow parameter here

<FullPageNotFoundView shouldShow={_.isEmpty(login) || !isValidContact}>

What alternative solutions did you explore? (Optional)

@c3024
Copy link
Contributor

c3024 commented Sep 25, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Invalid logins also are displayed in details page when the url is edited

What is the root cause of that problem?

We are not checking if the login parameter from url is a valid email or phone number in DetailsPage at

<FullPageNotFoundView shouldShow={_.isEmpty(login)}>

to show FullPageNotFoundView.

What changes do you think we should make in order to solve the problem?

We should get the login param from the url and check if it is a valid phone or email by adding

const parsedPhoneNumber = parsePhoneNumber(login);

and modifying this condition to the FullPageNotFoundView in the DetailsPage

<FullPageNotFoundView shouldShow={_.isEmpty(login) || (!parsedPhoneNumber?.possible && !Str.isValidEmail(login))}>

We are using parsePhoneNumber and Str.isValidEmail separately to validate the email or phone in several pages. We might consider making a function to check both.

What alternative solutions did you explore? (Optional)

@dukenv0307
Copy link
Contributor

DetailPage will be deprecated in the feature so I think we should close this now.

@situchan
Copy link
Contributor

DetailPage will be deprecated in the feature so I think we should close this now.

@dukenv0307 can you share link to that discussion?

@dukenv0307
Copy link
Contributor

@dhanashree-sawant
Copy link

Didn't we decide to not show the page for optimistic users only?

@situchan
Copy link
Contributor

We're close to accountID based mention implementation, which means Details page will be deprecated soon.
So I think we can just do nothing and close this issue for now.

@johncschuster
Copy link
Contributor

Thanks, @situchan! In that case, I'll go ahead and close the issue. If anyone disagrees, feel free to argue your case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

8 participants