[Security] Outdated Django Version with Known Vulnerabilities
- Dominant language
- Python
- Stars
- 2k
- Forks
- 984
- Avg merge
- 2h 54m
- Merged PRs (30d)
- 14
Description
## Summary
The project uses **Django 2.2.20** which reached **end-of-life on April 1, 2022** and contains multiple known security vulnerabilities (CVEs).
## Severity
🔴 **Critical** - Using unmaintained software with known vulnerabilities
## Current Version
- **Django**: 2.2.20 (in `requirements/common.txt`)
- **EOL Date**: April 1, 2022 (nearly 4 years ago)
- **Latest LTS**: Django 4.2 (supported until April 2026)
## Known Vulnerabilities
Django 2.2.x has multiple published CVEs including:
### SQL Injection Vulnerabilities
- CVE-2022-28346: SQL injection in QuerySet.annotate(), aggregate(), and extra()
- CVE-2022-28347: SQL injection via QuerySet.explain()
### XSS Vulnerabilities
- CVE-2021-45115: Denial-of-service possibility in UserAttributeSimilarityValidator
- CVE-2021-45116: Potential information disclosure in dictsort template filter
### Other Critical Issues
- CVE-2022-23833: Denial-of-service possibility in file uploads
- CVE-2021-44420: Potential bypass of an upstream access control
- CVE-2021-33203: Potential directory traversal via archive.extract()
- CVE-2021-33571: Possible indeterminate SSRF, RFI, and LFI attacks
## Security Impact
- **Exploit Risk**: Known vulnerabilities can be easily exploited
- **No Patches**: No security updates available for 2.2.x
- **Compliance Issues**: Using EOL software violates security policies
- **Audit Failures**: Will fail security audits and penetration tests
- **Legal/Insurance**: May violate terms of cyber insurance
## Additional Outdated Dependencies
The following related packages also need updates:
- `djangorestframework==3.10.3` (current: 3.14.0)
- `django-allauth==0.43.0` (current: 0.57.0)
- `django-cors-headers==3.5.0` (current: 4.3.0)
- `celery==4.3.0` (current: 5.3.4)
- `Pillow==7.1.0` (current: 10.x, multiple CVEs in 7.x)
## Recommended Fix
### Upgrade to Django 4.2 LTS
```python
django==4.2.9 # LTS version, supported until April 2026
```
### Update Related Dependencies
```python
djangorestframework==3.14.0
django-allauth==0.57.0
django-cors-headers==4.3.0
django-filter==23.3
celery==5.3.4
```
### Code Changes Required
- Update `JSONField` import: moved from `django.contrib.postgres.fields` to `django.db.models`
- Review deprecation warnings
- Test database migrations
- Check for breaking changes in Django 3.x and 4.x release notes
## Migration Path
1. Update requirements to Django 4.2.9
2. Fix JSONField imports in models
3. Run `python manage.py check --deploy`
4. Run full test suite
5. Test migrations on staging
6. Deploy to production
Contributor guide
Research direction
Start with requirements/common.txt and review the Django 3.x and 4.x release notes for the listed dependency upgrades and compatibility changes. Then inspect JSONField imports, run python manage.py check --deploy, the full test suite, and migration tests; done means the upgrades work without migration or deployment-check failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, databases, security
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100