GitHub Advisoryadvisory · Go

GHSA-4mq2-gc4j-cmw6 Django Template Engine Vulnerable to XSS

CRITICAL Published 2024-01-11 Modified 2024-01-11 Official page ↗
Aliases
CVE-2024-22199
Ecosystem
Go
Packages
github.com/gofiber/template/django/v3
Severity
Critical
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
Weaknesses
CWE-116, CWE-20, CWE-79
Reviewed
2024-01-11

Affected packages

• Go github.com/gofiber/template/django/v3: < 3.1.9 → fixed in 3.1.9

Description

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: ```django {% autoescape on %} {{ "alert('xss');" }} {% 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/

Related

Alias · CVE (1)

  • CVE-2024-22199 This package provides universal methods to use multiple template engines with the Fiber web framework using the Views interface. vulnerability

Weakness · CWE (3)

  • CWE-116 Improper Encoding or Escaping of Output weakness
  • CWE-20 Improper Input Validation weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation weakness

References