-
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
[$1000] uploading EPS extension file throws an error #24497
Comments
Triggered auto assignment to @strepanier03 ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalProblemuploading EPS extension file throws an error Root causeWe are not validating dropped file extension while we validate isValidFile. https://github.com/Expensify/App/blob/main/src/components/AttachmentModal.js#L186 ChangesIdeally all files with any type possible should not be supported. (IMO, should never support executable files like ".exe", ".msi"). Slack and google chat also blocks certain type of file uploads ref here and here Validating before uploading to backend is generally a good idea. We should add a condition to validate file extension. rough implementation - const {fileExtension} = FileUtils.splitExtensionFromFileName(lodashGet(file, 'name', ''));
if (_.contains(CONST.API_ATTACHMENT_VALIDATIONS.UNALLOWED_EXTENSIONS, fileExtension.toLowerCase())) {
setIsAttachmentInvalid(true);
setAttachmentInvalidReasonTitle('attachmentPicker.fileTypeNotAllowed'Title);
setAttachmentInvalidReason('attachmentPicker.fileTypeNotAllowedBody');
return false;
} AlternativesWhat we can do is only allow files with a set of extension and revert above condition. const {fileExtension} = FileUtils.splitExtensionFromFileName(lodashGet(file, 'name', ''));
if (!_.contains(CONST.API_ATTACHMENT_VALIDATIONS.ALLOWED_EXTENSIONS, fileExtension.toLowerCase())) {
setIsAttachmentInvalid(true);
setAttachmentInvalidReasonTitle('attachmentPicker.fileTypeNotAllowed'Title);
setAttachmentInvalidReason('attachmentPicker.fileTypeNotAllowedBody');
return false;
} |
I think It is BE bug. The error is threw from BE side |
@strepanier03 any updates on this issue? |
@strepanier03 It has been a week since this issue was posted, but there has been no response |
I was on sabbatical and am just getting back from it now. I'm working on this today and will have an update soon. |
Job added to Upwork: https://www.upwork.com/jobs/~01441ec377d38bb1cc |
Current assignee @strepanier03 is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @burczu ( |
@burczu - If you think this is an internal issue please let me know and I can switch to an |
I can upload the files without any issue on staging. |
@strepanier03 The |
@burczu I agree that error comes from BE. |
@ishpaul777 from what I see the app allows to upload any type of file - if it's not an image or pdf then you can just download the file (there is no preview in the report) and I guess it is done this way by design |
Platforms like Slack, Gmail and Google Chat have implemented restrictions on certain types of file uploads (references: Slack policy, Gmail and Google Chat policy). Considering this, it might be prudent for us to implement similar restrictions on the types of files users can upload. I recommend that we discuss and consider implementing a file type validation mechanism that only allows safe and necessary file types for upload. |
@burczu - reading the response from @ishpaul777 here, do you want to raise this for discussion at all or should I switch the labels now? |
@strepanier03 - I think for this issue we should just switch the labels @ishpaul777 - I can hear you and it's reasonable what you wrote, but I think it sounds more like a feature request so I believe you could raise a separate issue to discuss it - what do you think? |
Yes we can switch label for this one. Can you chime in slack thread https://expensify.slack.com/archives/C01GTK53T8Q/p1692691281183839 sharing your thoughts? |
Still waiting for internal ownership, I'll bump again internally this week. |
Hey @strepanier03 I had a second to look into this - I'm not seeing the error, on staging or production. Are you still able to reproduce? A sample Not sure what's changed since the issue was opened but we might be all set now. |
@dangrous Try it with other .eps files. |
@dangrous - I'll give it another shot. |
Ah yep, tried some others. Making a PR to fix |
Not overdue, fix is merged but not yet deployed |
This should be fixed! @strepanier03 do you mind testing when you have a moment? I might be able to get to it later this week |
Yup, I can test. Doing it now and will update shortly. |
I'm able to upload the files successfully and download them, but I don't have a program on my mac to open them. When I try it opens in ATOM, which isn't a vector file program. The behavior looks updated and correct if I had a program to open an EPS file though. |
Issue not reproducible during KI retests. (Second week) |
Okay I think I'm gonna close this out! |
@strepanier03 It is working perfectly on both staging and production. Can you send me an offer for the reporting bonus |
My bad! Reopening to handle payment. |
Thanks @dangrous - I'll work on the reporting payment and close out when it's wrapped. |
@strepanier03 I've applied for the job on upwork |
@dangrous, @burczu, @strepanier03 Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Thanks @jo-ui - I have hired you and will keep an eye out for your acceptance so I can pay this and get this closed out today. |
Thank you @strepanier03 I've accepted the offer on upwork |
I've paid out the contract, ended it, and left feedback. Thank you @jo-ui for being part of this community 🙌 |
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:
Expected Result:
The app should send the file or throw "This filetype is not allowed" pop-up.
Actual Result:
Gives an error saying "Invalid image supplied"
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.53-1
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
2023-07-31.00-06-33.mp4
Expensify/Expensify Issue URL:
Issue reported by: @jo-ui
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690751127702569
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: