alaouimehdi1995/django-rest

Vulnerabilities

4 via 4 paths

Dependencies

5

Source

GitHub

Commit

04c2cd9b

Find, fix and prevent vulnerabilities in your code.

Severity
  • 2
  • 1
  • 1
Status
  • 4
  • 0
  • 0

high severity

Insecure Permissions

  • Vulnerable module: django
  • Introduced through: django@3.0.7

Detailed paths

  • Introduced through: alaouimehdi1995/django-rest@alaouimehdi1995/django-rest#04c2cd9be5dcc9ba637df0b3f6c1f386c39d14ce django@3.0.7
    Remediation: Upgrade to django@3.0.10.

Overview

django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Affected versions of this package are vulnerable to Insecure Permissions. On Python 3.7 and above, FILE_UPLOAD_DIRECTORY_PERMISSIONS mode was not applied to intermediate-level directories created in the process of uploading files. It was also not applied to intermediate-level collected static directories when using the collectstatic management command.

Remediation

Upgrade django to version 2.2.16, 3.0.10, 3.1.1 or higher.

References

high severity

Insecure Permissions

  • Vulnerable module: django
  • Introduced through: django@3.0.7

Detailed paths

  • Introduced through: alaouimehdi1995/django-rest@alaouimehdi1995/django-rest#04c2cd9be5dcc9ba637df0b3f6c1f386c39d14ce django@3.0.7
    Remediation: Upgrade to django@3.0.10.

Overview

django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Affected versions of this package are vulnerable to Insecure Permissions. The intermediate-level directories of the filesystem cache had the system's standard umask rather than 0o077.

Remediation

Upgrade django to version 2.2.16, 3.0.10, 3.1.1 or higher.

References

medium severity
new

Web Cache Poisoning

  • Vulnerable module: django
  • Introduced through: django@3.0.7

Detailed paths

  • Introduced through: alaouimehdi1995/django-rest@alaouimehdi1995/django-rest#04c2cd9be5dcc9ba637df0b3f6c1f386c39d14ce django@3.0.7
    Remediation: Upgrade to django@3.0.13.

Overview

django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Affected versions of this package are vulnerable to Web Cache Poisoning. Django contains a copy of urllib.parse.parse_qsl() which was added to backport some security fixes. A further security fix has been issued recently such that parse_qsl() no longer allows using ; as a query parameter separator by default.

Remediation

Upgrade django to version 2.2.19, 3.0.13, 3.1.7 or higher.

References

low severity
new

Directory Traversal

  • Vulnerable module: django
  • Introduced through: django@3.0.7

Detailed paths

  • Introduced through: alaouimehdi1995/django-rest@alaouimehdi1995/django-rest#04c2cd9be5dcc9ba637df0b3f6c1f386c39d14ce django@3.0.7
    Remediation: Upgrade to django@3.0.12.

Overview

django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Affected versions of this package are vulnerable to Directory Traversal via the django.utils.archive.extract() function, which is used by startapp --template and startproject --template. This can happen via an archive with absolute paths or relative paths with dot segments.

Details

A Directory Traversal attack (also known as path traversal) aims to access files and directories that are stored outside the intended folder. By manipulating files with "dot-dot-slash (../)" sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system, including application source code, configuration, and other critical system files.

Directory Traversal vulnerabilities can be generally divided into two types:

  • Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.

st is a module for serving static files on web pages, and contains a vulnerability of this type. In our example, we will serve files from the public route.

If an attacker requests the following URL from our server, it will in turn leak the sensitive private key of the root user.

curl http://localhost:8080/public/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/root/.ssh/id_rsa

Note %2e is the URL encoded version of . (dot).

  • Writing arbitrary files: Allows the attacker to create or replace existing files. This type of vulnerability is also known as Zip-Slip.

One way to achieve this is by using a malicious zip archive that holds path traversal filenames. When each filename in the zip archive gets concatenated to the target extraction folder, without validation, the final path ends up outside of the target folder. If an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily.

The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicious file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:

2018-04-15 22:04:29 .....           19           19  good.txt
2018-04-15 22:04:42 .....           20           20  ../../../../../../root/.ssh/authorized_keys

Remediation

Upgrade django to version 2.2.18, 3.0.12, 3.1.6 or higher.

References