DefectDojo / django-DefectDojo

DevSecOps, ASPM, Vulnerability Management. All on one platform.

Home Page:https://defectdojo.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Unsupported extension" issue due to typo on supported file formats

MarMoriMem opened this issue · comments

Bug description

When trying to attach a file to a Finding (within a Finding, clicking on "Manage Files"), I get an error saying the following:
Unsupported extension. Supported extensions are as follows: .txt, .pdf, .json, .xml, .csv, .yml, .png, .jpeg, .sarif, .xslx, .doc, .html, .js, .nessus, .zip

The issue being file type ".xslx" - this is a typo of the Excel format, ".xlsx"

This means you are unable to attach files which are of .xlsx format.

I believe that the issue is located within the file:
dojo/settings/settings.dist.py
On line 277-279:
# List of acceptable file types that can be uploaded to a given object via arbitrary file upload DD_FILE_UPLOAD_TYPES=(list, ['.txt', '.pdf', '.json', '.xml', '.csv', '.yml', '.png', '.jpeg', '.sarif', '.xslx', '.doc', '.html', '.js', '.nessus', '.zip']),

Steps to reproduce
Steps to reproduce the behavior:

  1. Go to any Finding
  2. Click on Manage Files from the hamburger icon in the top right
  3. Try to upload a .xlsx file
  4. See error

Expected behavior
I expect to be able to upload Excel sheets.

Screenshots
Please see attached.
Screenshot 2024-07-05 140937

@MarMoriMem
Looks like @manuel-sommer has already created a PR for to fix this typo.

In the mean time, you can override the default set of allowed files by either setting an env variable for DD_FILE_UPLOAD_TYPES or override the value in local_settings.py