
CVE-2020-7471 Potenziale SQL injection tramite StringAgg(delimiter)
Questo repository fornisce l'ambiente e il POC per la vulnerabilità CVE-2020-7471: potenziale SQL injection tramite StringAgg(delimiter).
Installa una versione vulnerabile di Django. Io ho usato:
pip install django==3.0.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
Consulta https://www.runoob.com/postgresql/windows-install-postgresql.html per completare l'installazione del database PostgreSQL.
Crea un nuovo database
CREATE DATABASE test;
Modifica la configurazione del database in sqlvul_projects/settings.py. Se hai installato PostgreSQL con le impostazioni predefinite (inclusa la password impostata a postgres), non è necessario modificare nulla e puoi saltare questo passaggio.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'test', # Nome del database
'USER': 'postgres',
'PASSWORD': 'postgres', # Password dell'utente del database
'HOST': '127.0.0.1', # Indirizzo del database
'PORT': '5432',
}
}
Inizializza le tabelle dei dati tramite Django
python3 manage.py migrate
python3 manage.py makemigrations test_app
python3 manage.py migrate test_app
Poi esegui lo script POC poc.py.
Riferimento: https://github.com/Saferman/CVE-2020-7471