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 package | Versions | Reported by |
|---|---|---|
| gofiber template | < 3.1.9 | CVE List |
| github.com/gofiber/template/django/v3 (Go) | before 3.1.9 | GitHub Advisory Database, Go Vulnerability Database |
| gofiber django | before 3.1.9 | NVD |
All scores
| GitHub_M | 9.3critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N |
| GitHub | 9.3critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
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
- Official documentation of the Django template engine for Fiber: https://docs.gofiber.io/template/django/
- Django built-in template tags: https://docs.djangoproject.com/en/5.0/ref/templates/builtins/
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
| https://github.com/gofiber/template/security/advisories/GHSA-4mq2-gc4j-cmw6 | mitigation, vendor-advisory, web | |
| https://github.com/gofiber/template/commit/28cff3ac4d4c117ab25b5396954676d624b6cb46 | fix, patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2024-22199 | advisory | |
| https://github.com/gofiber/template | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-22199 changed 2024-11-14 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4mq2-gc4j-cmw6 changed 2026-09-10 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2024-2461 changed 2024-05-20 | CC-BY-4.0 |
| NVD | CVE-2024-22199 changed 2026-06-17 | Public domain |