---
id: CVE-2024-22199
aliases:
  - GHSA-4mq2-gc4j-cmw6
  - GO-2024-2461
title: Django Template Engine Vulnerable to XSS
summary: Django Template Engine Vulnerable to XSS
severity: critical
cvss: 9.3
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N'
vendor: gofiber
product: github.com/gofiber/template/django/v3
ecosystem: go
affected:
  - github.com/gofiber/template/django/v3 < 3.1.9
patched:
  - github.com/gofiber/template/django/v3 3.1.9
published: '2024-01-11'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:50:04.688331525Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-4mq2-gc4j-cmw6'
references:
  - url: >-
      https://github.com/gofiber/template/security/advisories/GHSA-4mq2-gc4j-cmw6
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2024-22199'
  - url: >-
      https://github.com/gofiber/template/commit/28cff3ac4d4c117ab25b5396954676d624b6cb46
  - url: 'https://github.com/gofiber/template'
tags:
  - osv
  - go
epss: 0.00484
epssPercentile: 0.39112
ingestedAt: '2026-09-12T03:13:01.753Z'
---

## Overview

### 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 %}
{{ "<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/


## Affected packages

- `github.com/gofiber/template/django/v3 < 3.1.9`

## Remediation

Upgrade to a patched release:

- `github.com/gofiber/template/django/v3 3.1.9`
