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

Security Vulnerability - Unrestricted File Upload #330

Open
LongWayHomie opened this issue Mar 17, 2022 · 0 comments
Open

Security Vulnerability - Unrestricted File Upload #330

LongWayHomie opened this issue Mar 17, 2022 · 0 comments

Comments

@LongWayHomie
Copy link

Describe the bug
Attacker can upload files with dangerous types to the OpenDocMan 1.4.4 via add.php using MIME-bypass.
File is available under specific ID, which is returned in response from application.

To Reproduce
Steps to reproduce the behavior:

  1. Login to the application
  2. Click on "Add Document"
  3. Create a file named "example.php.gif" containing string:
    GIF89a;<?php echo shell_exec($_GET['cmd']); ?>
  4. The document is being successfully uploaded and the Location header is describing the location of the file.
  5. The file is available under provided ID with .dat extension under /document_repository directory.

Expected behavior
Application should reject the file based on the magic bytes provided.

Screenshots
Step 1: Adding the document with malicious content.

proof

Step 2: Retrieving the content.

proof2

Versions (where applicable):

  • OpenDocMan: 1.4.4
  • MySQL: 10.4
  • PHP: 7.0
  • Web Server Type: Apache
  • Web Server Version: 2.4.51
  • OS: [e.g. iOS] Kali Linux/Debian
  • Browser [e.g. chrome, safari] Firefox
  • Browser Version [e.g. 22] 91.5.0esr
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

No branches or pull requests

1 participant