CVE-2024-22199
JSON

9.3critical

Django Template Engine Vulnerable to XSS

Severity
9.3critical CVSS:3.1 by GitHub_M
Exploit likelihood
0.48% (higher than 43% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4mq2-gc4j-cmw6GO-2024-2461

Description

This package provides universal methods to use multiple template engines with the Fiber web framework using the Views interface. This vulnerability specifically impacts web applications that render user-supplied data through this template engine, potentially leading to the execution of malicious scripts in users' browsers when visiting affected web pages. The vulnerability has been addressed, the template engine now defaults to having autoescape set to `true`, effectively mitigating the risk of XSS attacks.

Affected

Product or packageVersionsReported by
gofiber template< 3.1.9CVE List
github.com/gofiber/template/django/v3 (Go)before 3.1.9GitHub Advisory Database, Go Vulnerability Database
gofiber djangobefore 3.1.9NVD

All scores

GitHub_M9.3critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
GitHub9.3critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-20CWE-79CWE-116

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

This package provides universal methods to use multiple template engines with the Fiber web framework using the Views interface. This vulnerability specifically impacts web applications that render user-supplied data through this template engine, potentially leading to the execution of malicious scripts in users' browsers when visiting affected web pages. The vulnerability has been addressed, the template engine now defaults to having autoescape set to `true`, effectively mitigating the risk of XSS attacks.

GitHub Advisory Database
Impact

Vulnerability Type: Cross-Site Scripting (XSS)
Affected Users: All users of the Django template engine for Fiber prior to the patch. This vulnerability specifically impacts web applications that render user-supplied data through this template engine, potentially leading to the execution of malicious scripts in users' browsers when visiting affected web pages.

Patches

The vulnerability has been addressed. The template engine now defaults to having autoescape set to true, effectively mitigating the risk of XSS attacks. Users are advised to upgrade to the latest version of the Django template engine for Fiber, where this security update is implemented. Ensure that the version of the template engine being used is the latest, post-patch version.

Workarounds

For users unable to upgrade immediately to the patched version, a workaround involves manually implementing autoescaping within individual Django templates. This method includes adding specific tags in the template to control autoescape behavior:

{% autoescape on %}
{{ "<script>alert('xss');</script>" }}
{% endautoescape %}
References
Go Vulnerability Database

Cross-site scripting in github.com/gofiber/template/django/v3

NVD (es)

Este paquete proporciona métodos universales para usar múltiples motores de plantillas con el framework web de Fiber mediante la interfaz de Views. Esta vulnerabilidad afecta específicamente a las aplicaciones web que procesan datos proporcionados por el usuario a través de este motor de plantillas, lo que podría provocar la ejecución de scripts maliciosos en los navegadores de los usuarios cuando visitan las páginas web afectadas. La vulnerabilidad se ha abordado, el motor de plantillas ahora tiene de forma predeterminada el escape automático configurado en "true", mitigando efectivamente el riesgo de ataques XSS.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-22199 changed 2024-11-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-4mq2-gc4j-cmw6 changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2024-2461 changed 2024-05-20CC-BY-4.0
NVDCVE-2024-22199 changed 2026-06-17Public domain