Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS00bXEyLWdjNGotY213Ns4AA4Y6
Django Template Engine Vulnerable to XSS
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/
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS00bXEyLWdjNGotY213Ns4AA4Y6
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Critical
Classification: General
Published: 11 months ago
Updated: 11 months ago
CVSS Score: 9.3
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
Identifiers: GHSA-4mq2-gc4j-cmw6, CVE-2024-22199
References:
- https://github.com/gofiber/template/security/advisories/GHSA-4mq2-gc4j-cmw6
- https://github.com/gofiber/template/commit/28cff3ac4d4c117ab25b5396954676d624b6cb46
- https://nvd.nist.gov/vuln/detail/CVE-2024-22199
- https://github.com/advisories/GHSA-4mq2-gc4j-cmw6
Blast Radius: 6.5
Affected Packages
go:github.com/gofiber/template/django/v3
Dependent packages: 10Dependent repositories: 5
Downloads:
Affected Version Ranges: < 3.1.9
Fixed in: 3.1.9
All affected versions: 3.0.0, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8
All unaffected versions: 3.1.9, 3.1.10, 3.1.11, 3.1.12