-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2023-08-10] [$1000] Handle mentions renderer not receiving props #23811
Comments
Triggered auto assignment to @mallenexpensify ( |
This comment was marked as off-topic.
This comment was marked as off-topic.
Job added to Upwork: https://www.upwork.com/jobs/~0125cc67eabd576779 |
Triggered auto assignment to @muttmuure ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The MentionUserRenderer makes the app crash when rendering nested mention. This could be exploited to make any user’s app crash What is the root cause of that problem?In
we are removing the first character of the mention text with props.tnode.data.slice(1). This would work when the markdown component is a single component - which will be understood as a TText node. However, when an attacker purposely send a nested mention, the props.tnode value is a TPhrasing object, and this does not have the data value, which will cause the app to crash since props.tnode.data is undefined. What changes do you think we should make in order to solve the problem?We need to check if props.tnode.data is actually valid before applying the slice function
or something like
|
@puneetlath I've posted my proposal above. Can you help take a look at it? |
can anyone please share repro step to crash? |
STEPS TO REPRODUCEChange from
to const commentText = text; By doing this, we can customize and send any markdown texts to any users.
|
@aimane-chnaif Here you are #23811 (comment) |
function MentionUserRenderer(props) { // Rest of the component's logic |
does nested mention happen in real world? |
@tienifr null causes another crash. Empty string is fine.
I am still curious if we can send that weird message without any dev code change. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @danieldoglas, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@danieldoglas I'll take this since it deals with mentions and I'm already assigned here: https://github.com/Expensify/Expensify/issues/302711 |
📣 @aimane-chnaif 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
The PR #23845 is ready for review |
🎯 ⚡️ Woah @aimane-chnaif / @tienifr, great job pushing this forwards! ⚡️ The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉
On to the next one 🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.49-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-08-10. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@aimane-chnaif friendly bump on the checklist. @tienifr has been paid. |
As this is extreme edge case, regression test is not needed |
All paid. Thanks y'all! |
Problem
If for some reason the back-end doesn't return props that the mentions renderer expects, this causes the app to crash.
Solution
In the mentions renderer, handle the case where the expected props aren't provided.
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: