Regular expression denial of service (ReDoS) in jinja2
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Partial Red Hat: 5 fixed, 7 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-400.
Summary
This affects the package jinja2 from 0.0.0 and before 2.11.3. The ReDoS vulnerability is mainly due to the `_punctuation_re regex` operator and its use of multiple wildcards. The last wildcard is the most exploitable as it searches for trailing punctuation. This issue can be mitigated by Markdown to format user content instead of the urlize filter, or by implementing request timeouts and limiting process memory.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | jinja2 | 0.0.0 and later; before 2.11.3 | 2.11.3 | Patch available | CNA |
| — | Jinja2 (PyPI) | before 2.11.3 | 2.11.3 | Patch available | GHSA-g3rq-g295-4j3m |
- jinja2 Vendor— Affected 0.0.0 and later; before 2.11.3 Fixed in 2.11.3 Patch available CNA
- Jinja2 (PyPI) Vendor— Affected before 2.11.3 Fixed in 2.11.3 Patch available GHSA-g3rq-g295-4j3m
CPE configurations NVD · 2
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:palletsprojects:jinja:*:*:*:*:*:*:*:* | before 2.11.3 | Vulnerable | pallets |
| cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* | 33 | Vulnerable | Fedoraproject |
- cpe:2.3:a:palletsprojects:jinja:*:*:*:*:*:*:*:* Versions before 2.11.3 Vulnerable ·pallets
- cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* Versions 33 Vulnerable ·Fedoraproject
Remediation
- Fix · CNA jinja2 Fixed in 2.11.3
- Fix · GHSA-g3rq-g295-4j3m Jinja2 (PyPI) Fixed in 2.11.3 Advisory →
Red Hat 5 advisories
- RHSA-2021:4161 Released 2021-11-09 · Red Hat rating Moderatepython-jinja2 security update
- Red Hat Enterprise Linux AppStream (v. 8) python-jinja2-2.10.1-3.el8, python3-jinja2-2.10.1-3.el8
- RHSA-2021:4162 Released 2021-11-09 · Red Hat rating Moderatepython38:3.8 and python38-devel:3.8 security update
- Red Hat CodeReady Linux Builder (v. 8) pytest-4.6.6-3.module+el8.4.0+8888+89bc7e79.src::python38-devel:3.8, python-atomicwrites-1.3.0-8.module+el8.4.0+8888+89bc7e79.src::python38-devel:3.8, python-attrs-19.3.0-3.module+el8.4.0+8888+89bc7e79.src::python38-devel:3.8 +15
- Red Hat Enterprise Linux AppStream (v. 8) Cython-0.29.14-4.module+el8.4.0+8888+89bc7e79.src::python38:3.8, PyYAML-5.4.1-1.module+el8.5.0+10721+14d8e0d5.src::python38:3.8, babel-2.7.0-11.module+el8.5.0+11015+9c1c7c42.src::python38:3.8 +47
- RHSA-2021:4151 Released 2021-11-09 · Red Hat rating Moderatepython27:2.7 security update
- Red Hat Enterprise Linux AppStream (v. 8) Cython-0.28.1-7.module+el8.1.0+3111+de3f2d8e.src::python27:2.7, PyYAML-3.12-16.module+el8.1.0+3111+de3f2d8e.src::python27:2.7, babel-2.5.1-10.module+el8.5.0+11014+88fc0d0b.noarch::python27:2.7 +47
Show 2 more Red Hat advisories
- RHSA-2021:3252 Released 2021-08-24 · Red Hat rating Moderatepython27 security update
- Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) python27-babel-0.9.6-10.el7, python27-python-2.7.18-3.el7, python27-python-babel-0.9.6-10.el7 +8
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) python27-babel-0.9.6-10.el7, python27-python-2.7.18-3.el7, python27-python-babel-0.9.6-10.el7 +8
- Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) python27-babel-0.9.6-10.el7, python27-python-2.7.18-3.el7, python27-python-babel-0.9.6-10.el7 +8
- RHSA-2021:3254 Released 2021-08-24 · Red Hat rating Moderaterh-python38 security, bug fix, and enhancement update
- Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) rh-python38-babel-2.7.0-12.el7, rh-python38-python-3.8.11-2.el7, rh-python38-python-babel-2.7.0-12.el7 +14
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) rh-python38-babel-2.7.0-12.el7, rh-python38-python-3.8.11-2.el7, rh-python38-python-babel-2.7.0-12.el7 +14
- Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) rh-python38-babel-2.7.0-12.el7, rh-python38-python-3.8.11-2.el7, rh-python38-python-babel-2.7.0-12.el7 +14
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ceph Storage 2 | Affected | No fix planned: Out of support scope |
| Red Hat Ceph Storage 3 | Affected | No fix planned: Will not fix |
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat OpenStack Platform 13 (Queens) | Affected | No fix planned: Will not fix |
| Red Hat Quay 3 | Affected | No fix yet |
| Red Hat Satellite 6 | Affected | No fix yet |
| Red Hat CodeReady Linux Builder (v. 8) | Fixed | RHSA-2021:4162 |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2021:4151, RHSA-2021:4161, RHSA-2021:4162 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) | Fixed | RHSA-2021:3252, RHSA-2021:3254 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) | Fixed | RHSA-2021:3252, RHSA-2021:3254 |
| Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) | Fixed | RHSA-2021:3252, RHSA-2021:3254 |
Not affected: 3 products
- Red Hat Ansible Automation Platform 1.2
- Red Hat Ansible Tower 3
- Red Hat Enterprise Linux 9
Timeline
- 2026-10-02 Threatist record created from CVE-2020-28493
- 2026-10-03 Alias added: GHSA-g3rq-g295-4j3m
References
Advisory 4
Other 5
- https://github.com/pallets/jinja/blob/ab81fd9c277900c85da0c322a2ff9d68a235b2e6/src/jinja2/utils.py%23L20
- https://github.com/pallets/jinja/commit/15ef8f09b659f9100610583938005a7a10472d4d
- https://github.com/pallets/jinja
- https://github.com/pypa/advisory-database/tree/main/vulns/jinja2/PYSEC-2021-66.yaml
- https://lists.fedoraproject.org/archives/list/[email protected]/message/PVAKCOO7VBVUBM3Q6CBBTPBFNP5NDXF4
Sources
- CVE-2020-28493 · CVE Program
- CVE-2020-28493 · NVD
- FIRST EPSS
- GHSA-g3rq-g295-4j3m · GitHub Advisory Database · CC BY 4.0
- CVE-2020-28493 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences