Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2021-35042 PoC — Django SQL注入漏洞

Source
Associated Vulnerability
Title:Django SQL注入漏洞 (CVE-2021-35042)
Description:Django是Django基金会的一套基于Python语言的开源Web应用框架。该框架包括面向对象的映射器、视图系统、模板系统等。 Django 存在SQL注入漏洞,该漏洞源于未检测的用户输入传递给"QuerySet.order by()"可以在标记为弃用的路径中绕过预期的列引用验证,从而导致潜在的SQL注入。
Description
SQL injection via unsanitized QuerySet.order_by() input
Readme
# CVE-2021-35042
SQL injection via unsanitized QuerySet.order_by() input

# Setup:
Run `./setup.sh` for initial setup

Open the docker image to initiate the database:
`docker exec -it {container_id} /bin/bash`
And run the following commands:
```
python manage.py makemigrations cve202135042
python manage.py migrate
```

Start the instances using: 
`docker-compose up`

Now open the following URL to load sample data:

http://localhost:8000/load_example_data

Then go to the vulnerable page at:
http://localhost:8000/users/

Exploit the parameter at:
http://localhost:8000/users/?order_by=name
File Snapshot

[4.0K] /data/pocs/048b41b792d3e99fb788c68eba458a6df603e9dc ├── [4.0K] cve202135042 │   ├── [ 150] apps.py │   ├── [ 149] models.py │   ├── [3.3K] settings.py │   ├── [ 190] urls.py │   └── [ 656] views.py ├── [ 378] docker-compose.yml ├── [ 159] Dockerfile ├── [ 594] README.md ├── [ 35] requirements.txt └── [ 185] setup.sh 1 directory, 10 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.