Skip to content

File Upload uses first period to determine extension #8753

Closed
@MarcDerhammer

Description

@MarcDerhammer

New Issue Checklist

Issue Description

Uploading file names that contain periods before the extension causes the file extension validation to fail. For example, I can upload some file like file.png.html which should be blocked, but the extension is detected as .png.

Steps to reproduce

  1. Upload a file called file.png.html
  2. File uploads successfully but should have been stopped

Actual Outcome

File upload success

Expected Outcome

Request should have been rejected for File upload of extension html is disabled

Environment

Server

  • Parse Server version: 6.2.2
  • Operating system: MacOS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 4.4
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Android
  • SDK version: 4.2.0

Logs

Instead of first index of ., should it check for last index of . in the FilesRouter.js ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedReleased as stable versionstate:released-alphaReleased as alpha versionstate:released-betaReleased as beta versiontype:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions