CVE-2020-28493
JSON

5.3medium

Regular Expression Denial of Service (ReDoS)

Severity
5.3medium CVSS:3.1 by snyk
Exploit likelihood
3.59% (higher than 89% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
snyk
Also known as
GHSA-g3rq-g295-4j3mPYSEC-2021-66SNYK-PYTHON-JINJA2-1012994

Description

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.

Affected

Product or packageVersionsReported by
jinja2from 0.0.0 before unspecified, from unspecified before 2.11.3CVE List
jinja2 (PyPI)before 2.11.3GitHub Advisory Database, PyPA Advisory Database
palletsprojects jinjabefore 2.11.3NVD
fedoraproject fedora33NVD

All scores

snyk5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:P
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:P

Classification

What each source says

CVE List

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.

GitHub Advisory Database

This affects the package jinja2 from 0.0.0 and before 2.11.3. The ReDOS vulnerability of the regex is mainly due to the sub-pattern [a-zA-Z0-9.-]+.[a-zA-Z0-9.-]+ 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.

NVD (es)

Esto afecta al paquete jinja2 desde versiones 0.0.0 y anteriores a 2.11.3. La vulnerabilidad ReDoS se debe principalmente al operador `_punctuation_re regex` y su uso de múltiples comodines. El último comodín es el más explotable, ya que busca la puntuación final. Este problema puede ser mitigado con Markdown para formatear el contenido del usuario en lugar del filtro urlize, o implementando tiempos de espera de las peticiones y limitando la memoria del proceso

References

https://snyk.io/vuln/SNYK-PYTHON-JINJA2-1012994advisory, exploit, third-party-advisory, web
https://github.com/pallets/jinja/blob/ab81fd9c277900c85da0c322a2ff9d68a235b2e6/src/jinja2/utils.py%23L20broken-link, web
https://github.com/pallets/jinja/pull/1343patch, third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PVAKCOO7VBVUBM3Q6CBBTPBFNP5NDXF4/vendor-advisory
https://security.gentoo.org/glsa/202107-19third-party-advisory, vendor-advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2020-28493advisory
https://github.com/pallets/jinja/commit/15ef8f09b659f9100610583938005a7a10472d4dweb
https://github.com/advisories/GHSA-g3rq-g295-4j3madvisory
https://github.com/pallets/jinjapackage
https://github.com/pypa/advisory-database/tree/main/vulns/jinja2/PYSEC-2021-66.yamlweb
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PVAKCOO7VBVUBM3Q6CBBTPBFNP5NDXF4web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PVAKCOO7VBVUBM3Q6CBBTPBFNP5NDXF4/web

Sources

SourceRecordLicence
CVE ListCVE-2020-28493 changed 2024-09-16CVE Terms of Use
GitHub Advisory DatabaseGHSA-g3rq-g295-4j3m changed 2025-02-14CC-BY-4.0
NVDCVE-2020-28493 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2021-66 changed 2023-11-08CC-BY-4.0