An issue was discovered in Django 5.0 before 5.0.8 and 4.2 before 4.2.15. QuerySet.values() and values_list() methods on models with a JSONField are subject to SQL injection in column aliases via a crafted JSON object key as a passed *arg.
{ "availability": "No subscription required", "ubuntu_priority": "medium", "binaries": [ { "binary_version": "2:3.2.12-2ubuntu1.13", "binary_name": "python-django-doc" }, { "binary_version": "2:3.2.12-2ubuntu1.13", "binary_name": "python3-django" } ] }
{ "availability": "No subscription required", "ubuntu_priority": "medium", "binaries": [ { "binary_version": "3:4.2.11-1ubuntu1.2", "binary_name": "python-django-doc" }, { "binary_version": "3:4.2.11-1ubuntu1.2", "binary_name": "python3-django" } ] }