Advisory

GHSA-4mq2-gc4j-cmw6

Also known as: CVE-2024-22199, GO-2024-2461

Summary

Django Template Engine Vulnerable to XSS

Details

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/

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2024-01-11 16:41 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

github.com/gofiber/template/django/v3

Go · All systems

Affected

  • introduced 0, fixed 3.1.9 (semver)

Fixed versions

3.1.9

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences