{"answers":{"affected":"8 open source packages ship an affected version, including django and Django. It affects 1 product.","exploited":"There is no known exploitation of CVE-2020-7471 in the wild and no public exploit code.","fix":"Upgrade django to a fixed version for your release line: 1.11.28, 2.2.10 or 3.0.3.","what":"CVE-2020-7471 is a critical SQL injection vulnerability in Djangoproject Django, published on 3 Feb 2020. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2020-7471 and fix it if it is affected.\n\nWhat it is: CVE-2020-7471 is a critical SQL injection vulnerability in Djangoproject Django, published on 3 Feb 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2020-7471 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- django (Bitnami): affected from 1.11.0; fixed in 1.11.28, 2.2.10, 3.0.3\n- django (PyPI): affected all versions; fixed in 1.11.28\n- django (PyPI): affected from 1.11; fixed in 1.11.28, 2.2.10, 3.0.3\n- django (PyPI): affected from 2.0; fixed in 2.2.10\n- django (PyPI): affected from 3.0; fixed in 3.0.3\n- Django (PyPI): affected all versions; fixed in 1.11.28\n- Django (PyPI): affected from 2.0; fixed in 2.2.10\n- Django (PyPI): affected from 3.0; fixed in 3.0.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2020-7471/ (Markdown: https://insights.sbomify.com/CVE-2020-7471/index.md)","id":"CVE-2020-7471","markdown":"https://insights.sbomify.com/CVE-2020-7471/index.md","name":"CVE-2020-7471","record":{"aliases":["ALPINE-CVE-2020-7471","BIT-django-2020-7471","DEBIAN-CVE-2020-7471","DSA-4629-1","GHSA-hmr4-m2h5-33qx","PYSEC-2020-35","UBUNTU-CVE-2020-7471","USN-4264-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"Django web framework","requires_auth":"none","summary":"Attackers can inject malicious SQL via crafted delimiters in Django's StringAgg aggregate, potentially reading or modifying database contents.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mitre","cpe":[{"product":"django","vendor":"djangoproject"}],"cvss":{"score":9.8,"severity":"critical","source":"nvd","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"description":"Django 1.11 before 1.11.28, 2.2 before 2.2.10, and 3.0 before 3.0.3 allows SQL Injection if untrusted data is used as a StringAgg delimiter (e.g., in Django applications that offer downloads of data as a series of rows with a user-specified column delimiter). By passing a suitably crafted delimiter to a contrib.postgres.aggregates.StringAgg instance, it was possible to break escaping and inject malicious SQL.","ecosystems":["Bitnami","PyPI"],"exploits":{"exploitdb":0,"first_seen":"2020-02-11","github_poc":7,"max_poc_stars":103,"metasploit":0,"nuclei":0,"refs":[{"date":"2020-02-11T13:57:14Z","kind":"github_poc","ref":"https://github.com/Saferman/CVE-2020-7471","stars":103,"title":"django 漏洞：CVE-2020-7471  Potential SQL injection via StringAgg(delimiter) 的漏洞环境和 POC"},{"date":"2020-02-13T07:55:44Z","kind":"github_poc","ref":"https://github.com/secoba/DjVul_StringAgg","stars":2,"title":"Django StringAgg SQL Injection (CVE-2020-7471)"},{"date":"2020-02-22T01:32:40Z","kind":"github_poc","ref":"https://github.com/SNCKER/CVE-2020-7471","stars":2,"title":"CVE-2020-7471 Potential SQL injection via StringAgg(delimiter)"},{"date":"2021-06-03T11:21:27Z","kind":"github_poc","ref":"https://github.com/huzaifakhan771/CVE-2020-7471-Django","stars":1,"title":"PoC for the SQL injection vulnerability in PostgreSQL with Django, found in Django 1.11 before 1.11.28, 2.2 before 2.2.10, and 3.0 before 3.0.3"},{"date":"2020-08-03T05:29:25Z","kind":"github_poc","ref":"https://github.com/Tempuss/CTF_CVE-2020-7471","stars":0,"title":null},{"date":"2020-08-22T14:23:08Z","kind":"github_poc","ref":"https://github.com/victomteng1997/cve-2020-7471-Time_Blind_SQLi-","stars":0,"title":null},{"date":"2021-09-01T16:05:56Z","kind":"github_poc","ref":"https://github.com/mrlihd/CVE-2020-7471","stars":0,"title":"Reproduce CVE-2020-7471"}],"tier":"poc_unverified"},"has_fix":true,"headline":"SQL injection in Django","id":"CVE-2020-7471","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":"djangoproject:django","products":["djangoproject:django"],"type":"sql_injection","year":"2020"},"n_packages":8,"n_references":12,"next":{"headline":"Path traversal in n/a","id":"CVE-2020-7472"},"packages":[{"ecosystem":"Bitnami","fixed":["1.11.28","2.2.10","3.0.3"],"introduced":["1.11.0","2.2.0","3.0.0"],"last_affected":[],"package":"django","purl":"pkg:bitnami/django","source":"BIT-django-2020-7471"},{"ecosystem":"PyPI","fixed":["1.11.28"],"introduced":["0"],"last_affected":[],"package":"Django","purl":null,"source":"GHSA-hmr4-m2h5-33qx"},{"ecosystem":"PyPI","fixed":["2.2.10"],"introduced":["2.0"],"last_affected":[],"package":"Django","purl":null,"source":"GHSA-hmr4-m2h5-33qx"},{"ecosystem":"PyPI","fixed":["3.0.3"],"introduced":["3.0"],"last_affected":[],"package":"Django","purl":null,"source":"GHSA-hmr4-m2h5-33qx"},{"ecosystem":"PyPI","fixed":["1.11.28"],"introduced":["0"],"last_affected":[],"package":"django","purl":"pkg:pypi/django","source":"GHSA-hmr4-m2h5-33qx"},{"ecosystem":"PyPI","fixed":["1.11.28","2.2.10","3.0.3"],"introduced":["1.11","2.2","3.0"],"last_affected":[],"package":"django","purl":"pkg:pypi/django","source":"PYSEC-2020-35"},{"ecosystem":"PyPI","fixed":["2.2.10"],"introduced":["2.0"],"last_affected":[],"package":"django","purl":"pkg:pypi/django","source":"GHSA-hmr4-m2h5-33qx"},{"ecosystem":"PyPI","fixed":["3.0.3"],"introduced":["3.0"],"last_affected":[],"package":"django","purl":"pkg:pypi/django","source":"GHSA-hmr4-m2h5-33qx"}],"prev":{"headline":"Cross-site scripting in n/a","id":"CVE-2020-7470"},"products":["n/a"],"published":"2020-02-03","related":[{"cvss_score":9.8,"headline":"Privilege abuse in GenericInlineModelAdmin","id":"CVE-2026-4277","kev_date_added":null,"published":"2026-04-07"},{"cvss_score":9.8,"headline":"Django SQL injection in HasKey(lhs, rhs) on Oracle","id":"CVE-2024-53908","kev_date_added":null,"published":"2024-12-06"},{"cvss_score":9.8,"headline":"Django SQL injection vulnerability","id":"CVE-2024-42005","kev_date_added":null,"published":"2024-08-07"},{"cvss_score":9.8,"headline":"Django bypasses validation when using one form field to upload multiple files","id":"CVE-2023-31047","kev_date_added":null,"published":"2023-05-07"},{"cvss_score":9.8,"headline":"Django `Trunc()` and `Extract()` database functions vulnerable to SQL Injection","id":"CVE-2022-34265","kev_date_added":null,"published":"2022-07-04"},{"cvss_score":9.8,"headline":"SQL Injection in Django","id":"CVE-2021-35042","kev_date_added":null,"published":"2021-07-02"}],"sources":[{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-04","vendors":["n/a"]},"summary":"Attackers can inject malicious SQL via crafted delimiters in Django's StringAgg aggregate, potentially reading or modifying database contents.","url":"https://insights.sbomify.com/CVE-2020-7471/"}