GHSA-r28v-mw67-m5p9 CVE-2018-7536 PYSEC-2018-5
Django denial-of-service possibility in urlize and urlizetrunc template filters
- Severity
- 0.0 / 10
- Medium · CVSS 4.0
- Exploit chance (EPSS)
- 4.55%
- Chance of exploitation in the next 30 days. Higher than 91.59% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-185 Incorrect Regular Expression
- Fix
2.0.3- Upgrade django to this version or later
Description
An issue was discovered in Django 2.0 before 2.0.3, 1.11 before 1.11.11, and 1.8 before 1.8.19. The django.utils.html.urlize() function was extremely slow to evaluate certain inputs due to catastrophic backtracking vulnerabilities in two regular expressions (only one regular expression for Django 1.8.x). The urlize() function is used to implement the urlize and urlizetrunc template filters, which were thus vulnerable.
Affected versions
PyPI
| Package | Vulnerable | Fixed in |
|---|---|---|
| django | >= 2.0a1, < 2.0.3 |
2.0.3 |
| django | >= 1.11a1, < 1.11.11 |
1.11.11 |
| django | >= 1.8a1, < 1.8.19 |
1.8.19 |
| django | >= 1.8, < 1.8.19>= 1.11, < 1.11.11>= 2.0, < 2.0.3 |
1.8.191.11.112.0.3 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
django PyPI → 2.0.3
- pip
pip install --upgrade "django>=2.0.3"- poetry
poetry add "django>=2.0.3"- uv
uv add "django>=2.0.3"
Severity breakdown
CVSS 4.0 0.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- None
- User interaction
- None
- Confidentiality (vulnerable system)
- None
- Integrity (vulnerable system)
- Low
- Availability (vulnerable system)
- None
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
CVSS 3.0 5.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Weakness
CWE-185: Incorrect Regular Expression
The product specifies a regular expression in a way that causes data to be improperly matched or compared.
How to prevent it
- Implementation: Regular expressions can become error prone when defining a complex language even for those experienced in writing grammars. Determine if several smaller regular expressions simplify one large regular expression. Also, subject the regular expression to thorough testing techniques such as equivalence partitioning, boundary value analysis, and robustness. After testing and a reasonable confidence level is achieved, a regular expression may not be foolproof. If an exploit is allowed to slip through, then record the exploit and refactor the regular expression.
References
Advisories
Write-ups
Packages
Other links
- github.com/django/django/commit/1ca63a66ef3163149ad822701273e8a1844192c2
- github.com/django/django/commit/abf89d729f210c692a50e0ad3f75fb6bec6fae16
- github.com/django/django/commit/e157315da3ae7005fa0683ffc9751dbeca7306c8
- access.redhat.com/errata/RHSA-2018:2927
- access.redhat.com/errata/RHSA-2019:0051
- access.redhat.com/errata/RHSA-2019:0082
- access.redhat.com/errata/RHSA-2019:0265
- github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2018-5.yaml
- lists.debian.org/debian-lts-announce/2018/03/msg00006.html
- usn.ubuntu.com/3591-1
- web.archive.org/web/20200227131019/http://www.securityfocus.com/bid/103361
- debian.org/security/2018/dsa-4161
- djangoproject.com/weblog/2018/mar/06/security-releases
- securityfocus.com/bid/103361
- usn.ubuntu.com/3591-1
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-q238-5cxm-5c9h Django GeoDjango vulnerable to denial of service through deeply nested geometry collections | Medium | Also affects django |
| GHSA-wvqv-fj8w-qmhm Django GeoDjango spatial lookups allow file writes and outbound requests through GDAL raster parsing | High | Also affects django |
| GHSA-8qcx-xf44-272x Django: DomainNameValidator permits newline characters that may enable HTTP header injection | Medium | Also affects django |
| GHSA-crhf-3pfg-w68w Django: GDALRaster may over-read heap memory when constructed from bytes | Medium | Also affects django |
| GHSA-3h9f-r86x-qvjx Django: cache middleware may expose private responses when unrelated request cookies are present | Medium | Also affects django |
| GHSA-8cjm-8mp7-r2xf Django: UpdateCacheMiddleware may disclose cached responses due to case-sensitive Cache-Control handling | Medium | Also affects django |
| GHSA-mm6v-q8q9-pgcf Django fails to prevent reuse of a partially-initialized connection after a failed `STARTTLS` handshake | Low | Also affects django |
| GHSA-h7pc-vwp9-298g Django: signed cookies are vulnerable to salt namespace collisions | Medium | Also affects django |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor