Project

General

Profile

Actions

Bug #71

closed

Feature #65: Security Audit

[Security Audit ] 6- Unrestricted File Upload

Added by Kalyan Battula about 1 year ago. Updated 7 months ago.

Status:
Closed
Priority:
High
Assignee:
Karthik Daram
Category:
-
Target version:
Start date:
17/04/2024
Due date:
% Done:

0%

Estimated time:
Deployed In:
Category:

Description

6- Unrestricted File Upload
CWE : CWE-434
Description :
The application fails to restrict the file types that the user uploads. The application
accepted the files with the double extension when tried to upload. If tshe uploaded file
contains any malicious content such as macros it may cause an adversary result in the
server.
Affected Path(s) :
https://earogya.satragroup.in/patient/0/patient-Registration *-Applicable to entire
application
Impact :
An attacker can upload the malicious files that can be used as the backdoor for the later
attacks in an attempt to compromise the whole server.
Recommendation :
1. List allowed extensions. Only allow safe and critical extensions for business
functionality. Ensure that input validation is applied before validating the extensions. 2.
Validate the file type, don't trust the Content-Type header as it can be spoofed 3. Change
the filename to something generated by the application 4. Set a filename length limit.
Restrict the allowed characters if possible 5. Set a file size limit 6. Only allow authorized
users to upload files 7. Store the files on a different server. If that's not possible, store
them outside of the webroot. In the case of public access to the files, use a handler that
gets mapped to filenames inside the application (someid -> file.ext) 8. Run the file
through an antivirus or a sandbox if available to validate that it doesn't contain
malicious data 9. Ensure that any libraries used are securely configured and kept up to
date 10. Protect the file upload from CSRF attacks Reference:
https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html
Evidence/Proof Of Concept :
Step 1: Login to the application with "test1_fd" Credentials and Now go Source and
Destination entry form and fill form.Details saved successfully with malicious file as shown as
below screenshot.


Files

clipboard-202404171538-9dmn9.png (134 KB) clipboard-202404171538-9dmn9.png Kalyan Battula, 17/04/2024 03:38 PM
Actions #1

Updated by Uma Maheswarachari Melpati 12 months ago

  • Assignee set to Karthik Daram
Actions #2

Updated by Karthik Daram 12 months ago

  • Status changed from New to Resolved
Actions #3

Updated by Sivakanth Kesiraju 12 months ago

  • Target version set to Sprint 1 (29th April - 3rd May)
Actions #4

Updated by Sivakanth Kesiraju 12 months ago

  • Target version changed from Sprint 1 (29th April - 3rd May) to Security Audit
Actions #5

Updated by Gautam Kumar 7 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF