Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

[$30] able to upload all types of files after changing the extension to ".xlsx" in upload profile data tab #269

Closed
rprakash20 opened this issue Jul 12, 2020 · 8 comments
Assignees
Labels

Comments

@rprakash20
Copy link

Steps to Reproduce

  1. Open https://skill-search.topcoder-dev.com/ web app
  2. Login with tonyj /appirio123
  3. Select topcoder as organization
  4. Navigate to third tab
  5. Now on your system, take a image file and change its's extension to ".xlsx"
  6. Now click on browse and select the file whose extension is changes in previous step and upload
  7. Notice the result

Screenshots or Screen Capture

Screenshot 2020-07-12 at 8 45 57 PM

Screenshot 2020-07-12 at 8 46 08 PM

Current Results

able to upload all types of files after changing the extension to ".xlsx" in upload profile data tab

Expected Results

application must validate the MIME type of the file uploaded before saving it. This can be a big security risk.

Browser version and OS version

  • Device: MacBook Pro 13 inch
  • Browser: Chrome Version 83.0.4103.116 (Official Build) (64-bit)
  • OS Version: macOS Catalina 10.15.4
@callmekatootie callmekatootie self-assigned this Jul 16, 2020
@callmekatootie
Copy link
Collaborator

Valid bug.

@callmekatootie callmekatootie removed their assignment Jul 17, 2020
@callmekatootie callmekatootie added the bug Something isn't working label Jul 17, 2020
@wdprice wdprice added the high priority Must-fix issue label Jul 20, 2020
@wdprice wdprice added this to the v1.0 - Initial Launch milestone Jul 20, 2020
@callmekatootie callmekatootie self-assigned this Jul 21, 2020
@callmekatootie
Copy link
Collaborator

Expected: In the backend (under the src folder), in the api handle, detect the file type using https://www.npmjs.com/package/file-type module and reject if the file type is not among the supported file types

Note that for csv and xls, the module will return undefined and that is ok - in such a case, just ensure that the file.type is in the approved list

@callmekatootie callmekatootie changed the title able to upload all types of files after changing the extension to ".xlsx" in upload profile data tab [$30] able to upload all types of files after changing the extension to ".xlsx" in upload profile data tab Jul 25, 2020
@callmekatootie callmekatootie removed their assignment Jul 25, 2020
@cwdcwd
Copy link
Contributor

cwdcwd commented Jul 25, 2020

Contest https://www.topcoder.com/challenges/30134277 has been created for this ticket.

This is an automated message for lazybaer via Topcoder X

@cwdcwd
Copy link
Contributor

cwdcwd commented Jul 25, 2020

Contest https://www.topcoder.com/challenges/30134277 has been updated - it has been assigned to Suman-953556.

This is an automated message for lazybaer via Topcoder X

@callmekatootie
Copy link
Collaborator

@Giri-Suman I am afraid I have to open this for others to work on

@cwdcwd
Copy link
Contributor

cwdcwd commented Jul 26, 2020

Contest https://www.topcoder.com/challenges/30134277 has been updated - it has been assigned to cagdas001.

This is an automated message for lazybaer via Topcoder X

cagdas001 added a commit to cagdas001/u-bahn-app that referenced this issue Jul 26, 2020
Add mime-type check at `UploadService#create`.

Addresses topcoder-archive#269
@cagdas001
Copy link
Collaborator

PR: #608

@cwdcwd
Copy link
Contributor

cwdcwd commented Jul 26, 2020

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30134277

This is an automated message for lazybaer via Topcoder X

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants