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

feat: allow zip files and block password-protected files #2203

Merged
merged 1 commit into from
May 29, 2023

Conversation

halfwhole
Copy link
Collaborator

@halfwhole halfwhole commented Apr 19, 2023

Problem

We want to allow users to upload zip files, but block users from uploading password-protected files (zip, pdf or otherwise) as Cloudmersive cannot properly scan them for viruses.

Solution

  1. Allow zip files to be uploaded
  2. Switch from using basic file scanning to advanced file scanning on Cloudmersive. This gives us additional options to tell if the file is password protected or not, and block it from being uploaded if it is.

Tests

On staging, we should test the following:

  • Regular non-password-protected files are allowed to be uploaded, including zip files
  • Password-protected files (zip, pdf) are blocked from being uploaded
  • 20mb files can still be scanned and uploaded within a reasonable amount of time

Should also update the tests on the release checklist to include password-protected zip/pdf files, if applicable?

Deploy Notes

Unfortunately, this change doesn't do anything to address the already existing password-protected pdf files on Go, which have not been properly scanned for viruses :(

Copy link
Contributor

@thanhdatle thanhdatle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well in stg!

@halfwhole halfwhole merged commit b3045c5 into develop May 29, 2023
@halfwhole halfwhole deleted the feat/allow-zip-files branch May 29, 2023 03:18
@disKeith disKeith mentioned this pull request May 29, 2023
22 tasks
disKeith added a commit that referenced this pull request May 30, 2023
* fix: package.json & package-lock.json to reduce vulnerabilities (#2207)

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-XML2JS-5414874

* feat: allow zip files and block password-protected files (#2203)

* feat: admin api v1 - create url (#2213)

* feat: api v2 endpoint and update admin auth middleware

* chore: add and handle external user creation

* chore: rename admin api env variable

* chore: api v2 unit testing

* chore: add integration tests

* chore: update test api key string

* chore: update unauthorized user error

* chore: undo conditional user creation

* chore: update admin email env var parsing

* chore: port to admin api v1 and update unit and integration tests

* chore: remove external user type and add domain validation error msg

* chore: remainder port from v2 to admin v1

* chore: add missing return in external v1

* fix: ownership transfer condition and tests

* chore: move api structure and update tests

* chore: update readme

* chore: add email domain validation to schema

* chore: fix error type for generic errors

* chore: undo types from external v1

* 1.76.0

---------

Co-authored-by: halfwhole <41856541+halfwhole@users.noreply.github.com>
Co-authored-by: Snyk bot <snyk-bot@snyk.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants